Run spider script files as javascript modules in NodeJS.
JavaScript
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github
docs
lib
project/config
test
.editorconfig
.eslintrc.js
.gitattributes
.gitignore
.jsbeautifyrc
.jscs.json
.jshintrc
.jslintrc
.npmignore
.travis.yml
Gruntfile.js
LICENSE
README.md
inch.json
index.js
package.json
stylelint.config.js

README.md

node-spider-script

NPM Version Build Status Coverage Status Inline docs
License Total Downloads Dependency Status devDependency Status

Load spider script as any javascript modules under nodeJS runtime.

Overview

Spider is a programming language that compiles to JavaScript. It takes the best ideas of Swift, Python, C# and CoffeeScript.

See spiderlang.org for more information.

Usage

In order to use spider scripts under node, you need to first require this library as follows

require('node-spider-script');

Now you can require your spider files like any other javascript files, for example:

var jsModule = require('./my-test.spider');

var person = jsModule.create('my name');
var output = person.listen('my noise');

In your spider file, instead of doing module.exports, do return to the object you wish to export.

For example:

return {
    create: fn(name) {
        return new Person(name);
    }
};

Full example (Spider):

fn Person(name) {
  this.name = name;

  this.listen = fn (text) {
    return this.name + ' ' + text;
  };
}

return {
    create: fn(name) {
        return new Person(name);
    }
};

Full example (JavaScript):

require('node-spider-script');

var jsModule = require('./my-test.spider');

var person = jsModule.create('my name');
var output = person.listen('my noise');

Installation

In order to use this library, just run the following npm install command:

npm install --save node-spider-script

API Documentation

See full docs at: API Docs

Contributing

See contributing guide

Release History

Date Version Description
2018-06-13 v1.0.38 Maintenance
2015-02-06 v0.0.20 Grunt cleanups
2014-12-07 v0.0.16 Minor internal changes
2014-12-01 v0.0.14 Added continues integration support for the project
2014-11-30 v0.0.13 Internal changes due to spider dependency changes
2014-11-29 v0.0.12 Updated spider dependency
2014-11-29 v0.0.11 Internal improvements
2014-11-22 v0.0.7 JSDoc changes
2014-11-22 v0.0.6 Fixed pure require approach
2014-11-22 v0.0.5 Initial release

License

Developed by Sagie Gur-Ari and licensed under the Apache 2 open source license.