@shelter/shelv-runner

The library that processes Shelv tasks on Shelv workers, as well as a docker container with the correct environment to run the tasks.

Usage no npm install needed!

<script type="module">
  import shelterShelvRunner from 'https://cdn.skypack.dev/@shelter/shelv-runner';
</script>

README

shelv-runner

The library that processes Shelv tasks on Shelv workers, as well as a docker container with the correct environment to run the tasks.

The docker container has shelv-runner installed globally using yarn.

Usage

CLI

shelv-runner input.json output.json

This will read a task from input.json and output the result to output.json.

Library

import { runTask, ShelvTask } from 'shelv-runner';

(async () => {
    const task: ShelvTask = {
        url: 'http://google.com/'
    };

    const result = await runTask(task);

    console.log(result);
})();

Docker Container

The docker container has the shelv CLI set as the entrypoint, so can be run like so:

docker run $IMAGE_NAME input.json output.json