0.1.5 • Published 9 years ago

sarah v0.1.5

Weekly downloads
4
License
ISC
Repository
github
Last release
9 years ago

Build Status

npm status

Sarah platform

Important warning: The Sarah Platform and all sub-modules are far from ready and absolutely unsuitable for production code at this moment.

What is it?

The sarah platform is a configurable and extendable platform which can be used for simplifying automated tasks. Based on the idea of IFTTT (if this then that) it uses NPM packages called "triggers" to execute code.

Currently, there are three types of classes:

  1. Triggers
  2. Tasks
  3. Generators

Getting started

See the Wiki for a guid how to get started and more.

Requirements

Currently we need Node.js version 4 or later to compile the Sarah platform code. This is needed because Sarah is completely programmed using ES6 (Ecmascript 6). The new standard for Javascript.

To run code using the Sarah platform you need a couple of flags for Node.js. These flags are currently:

  • --harmony_arrow_functions
  • --use_strict
  • --harmony_rest_parameters
  • --harmony_array_includes

This makes the following command: node --harmony_arrow_functions --use_strict --harmony_rest_parameters --harmony_array_includes index.js

Application

Create an application

See the /examples directory.

API

AppDomain

domain.trigger(String name, [Object config])

Create a new generator of a certain trigger.

Bootstrapper

bootstrap.setLogging(Boolean enabled)

Enable or disable sarah logging.

bootstrap.run(String root)

Run all tasks.

Configuration

config.addTrigger(Function trigger)

Add a trigger to the configuration.

config.setConfig(Object config)

Overwrite all configuration data.

config.clone()

Safely (deep)clone the configuration class.

config.addTask(String path)

Add a task.

config.get(String key)

Get a configuration-item.

config.set(String key, Mixed value)

Set a certain configuration item.

config.name(String name)

Set the name of a trigger.

config.access(String key, String alias)

Access a configuration item and set the value using alias.