🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

sand-grain

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sand-grain

The base grain/module for Sand

latest
Source
npmnpm
Version
1.2.1
Version published
Weekly downloads
4
-33.33%
Maintainers
2
Weekly downloads
 
Created
Source

Build Status npm version

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

Keywords

Sand

FAQs

Package last updated on 30 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts