UNPKG

rallf-js-sdk

Version:

Toolset to create Tasks for RALLF

117 lines (88 loc) 4.14 kB
<!-- Docs links --> [docs:manifest]: https://github.com/RobotUnion/rallf-js-sdk/wiki/Manifest [docs:cli]: https://github.com/RobotUnion/rallf-js-sdk/wiki/CLI [docs:Task]: https://github.com/RobotUnion/rallf-js-sdk/wiki/Integration---Task [docs:Skill]: https://github.com/RobotUnion/rallf-js-sdk/wiki/Integration---Skill [docs:Running]: https://github.com/RobotUnion/rallf-js-sdk/wiki/Running-Tasks [docs:Creating]: https://github.com/RobotUnion/rallf-js-sdk/wiki/Creating-Tasks [docs:GettingStarted]: https://github.com/RobotUnion/rallf-js-sdk/wiki/Getting-Started [license-img]: https://img.shields.io/github/license/RobotUnion/rallf-js-sdk.svg?style=flat-square [github-link]: https://github.com/RobotUnion/rallf-js-sdk [rallf-status-img]: https://img.shields.io/website-up-down-green-red/https/api.rallf.com.svg?label=site&style=flat-square [rallf-link]: https://rallf.com [npm-version-img]: https://img.shields.io/npm/v/rallf-js-sdk.svg?style=flat-square [npm-link]: https://www.npmjs.com/package/rallf-js-sdk [gh-pkg-version-img]: https://img.shields.io/github/package-json/v/RobotUnion/rallf-js-sdk.svg?style=flat-square [npm-deps-img]: https://img.shields.io/david/RobotUnion/rallf-js-sdk.svg?style=flat-square [wiki-img]: https://img.shields.io/badge/wiki-github-green.svg?longCache=true&style=flat-square [wiki-link]: https://github.com/RobotUnion/rallf-js-sdk/wiki <p align="center"> <a href="http://rallf.com"> <img src="https://robotunion.net/wp-content/uploads/2016/10/CREAR-BOT3.png" height="200"> </a> </p> <h1 align="center">RALLF Node.js SDK</h1> <div align="center"> <p>Toolset to create, test & deploy <b>Tasks</b> for <a href="https://rallf.com">RALLF</a> <i>(<b>NodeJS</b> Edition)</i></p> [![CircleCI](https://circleci.com/gh/RobotUnion/rallf-js-sdk.svg?style=svg)](https://circleci.com/gh/RobotUnion/rallf-js-sdk) [![npm]( https://img.shields.io/npm/v/rallf-js-sdk.svg?style=flat-square)](https://www.npmjs.com/package/rallf-js-sdk) [![Dependencies][npm-deps-img]][github-link] [![Downloads](https://img.shields.io/npm/dw/rallf-js-sdk.svg?style=flat-square)]() [![License][license-img]][github-link] [![Website][rallf-status-img]][rallf-link] [![wiki][wiki-img]][wiki-link] <!-- Docs: [CLI][docs:cli], [Task][task-docs], [Skill][skill-docs], [Manifest][manifest-docs], [Creating][docs-create], [Running][docs-running] --> [`🔗 Getting Started`][docs:GettingStarted] [`🔗 Creating`][docs:Creating] [`🔗 Running`][docs:Running] [`🔗 CLI`][docs:cli] [`🔗 Manifest`][docs:manifest] [`🔗 Skill`][docs:Skill] [`🔗 Task`][docs:Task] </div> **** ## Resources * [Installing](#installing) * [Getting Started](#getting-started) * [Wiki](https://github.com/RobotUnion/rallf-sdk/wiki) * [Examples](examples) ## Installing To have access to global [commands][docs:cli], run: ```zsh $ npm install rallf-js-sdk -g ``` For using for development, run inside your task project: ```zsh $ npm install rallf-js-sdk ``` ## Getting Started Now you can check the [Getting Started][docs:GettingStarted] guide to start developing 🤖! ## Overview ```js const rallf = require('rallf-js-sdk'); class MyTask extends rallf.Task { constructor() { super(); this.firefox = null; } async warmup() { this.logger.debug('warmup'); this.firefox = await this.devices.get('firefox'); await this.firefox.get('https://github.com'); } async start(input) { this.logger.debug(this.fqtn + ' started'); return await this.firefox.getTitle(); } async cooldown() { this.logger.debug('cooldown'); await this.firefox.quit(); } } ``` ## Found a bug? If you found a bug please leave us an issue. * Make sure you check the [contributing guidelines](https://github.com/RobotUnion/rallf-js-sdk/blob/master/.github/CONTRIBUTING.md) before. * Make sure that issue has not been reported ## Want to collaborate? We love contributions from people, refer to the [contributing guidelines](https://github.com/RobotUnion/rallf-js-sdk/blob/master/.github/CONTRIBUTING.md) for information on how to get started and how we work. Also and don't hesitate in contacting us.