1.2.1 • Published 9 years ago
sand-grain v1.2.1
Sand Base Grain/Module
All Grains (Modules) used by Sand must first extend this base grain.
To begin
Install it:
$ npm install sand-grain -S
Create a new module which extends SandGrain and implement
SandGrain.name
property,SandGrain.init()
method and, optionally,SandGrain.shutdown()
var SandGrain = require('sand-grain'); var MyModule = SandGrain.extend({ name: 'MyModule', // required init: function(config, done) { // required this.super(config, done); // your initialization goes here }, shutdown: function(done) { // optional // implementing this hook is optional // your shutdown logic goes here // Make sure to call done when you are done shutting down } // add other public functions that you'd like to export here });
Use your shiny new module with Sand
var sand = require('sand')(); var MyModule = require('my-sand-module'); sand.use(MyModule).start(); // now that sand is started, you can use sand.MyModule.myFunction() anywhere in your project
License
ISC © 2014 Pocketly
1.2.1
9 years ago
1.2.0
9 years ago
1.1.1
10 years ago
1.1.0
10 years ago
1.0.1
10 years ago
1.0.0
10 years ago
0.1.2
11 years ago
0.1.1
11 years ago
0.1.0
11 years ago
0.0.12
11 years ago
0.0.11
11 years ago
0.0.10
11 years ago
0.0.9
11 years ago
0.0.8
11 years ago
0.0.7
11 years ago
0.0.6
11 years ago
0.0.5
11 years ago
0.0.4
11 years ago
0.0.3
11 years ago
0.0.2
11 years ago
0.0.1
11 years ago