airplane

Node.js SDK for writing Airplane.dev tasks in JavaScript and TypeScript.

Usage no npm install needed!

<script type="module">
  import airplane from 'https://cdn.skypack.dev/airplane';
</script>

README

Airplane Node.js SDK npm License CI status

Node.js SDK for writing Airplane.dev tasks in JavaScript and TypeScript.

Getting started

npm install airplane

Usage

To write a Node.js task in Airplane, create a .js or .ts file and export a function like so:

import airplane from 'airplane'

export default async function(parameters) {
  airplane.output(`Hello, ${parameters.name}!`)
}

You can configure the parameters that your task will receive in the Airplane UI. They'll be passed through the parameters argument to your function as an object keyed by the slugs you see in the UI.

To execute your task, first install the Airplane CLI.

Once installed, execute your task locally:

airplane execute ./path/to/file.js -- --name=World

If that looks good, deploy your task to Airplane then give it a run in the UI!

airplane deploy ./path/to/file.js