# sand-grain

> The base grain/module for Sand

Latest version **1.2.1** (published 2016-09-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install sand-grain
pnpm add sand-grain
yarn add sand-grain
bun add sand-grain
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2016-09-30 |
| First published | 2014-12-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kevin Smithson |
| Maintainers | ksmithson, jacinto |
| Keywords | Sand, module |

## Links

- npm: https://www.npmjs.com/package/sand-grain
- Repository: https://github.com/pocketly/sand-grain
- Issues: https://github.com/pocketly/sand-grain/issues
- npm.io page: https://npm.io/package/sand-grain

## Dependencies (2)

- [only](https://npm.io/package/only.md) 0.0.2
- [lodash](https://npm.io/package/lodash.md) ^2.4.1

## Recent versions

- 1.2.1 (latest) — 2016-09-30
- 1.2.0 — 2016-09-30
- 1.1.1 — 2015-08-23
- 1.1.0 — 2015-08-23
- 1.0.1 — 2015-07-22
- 1.0.0 — 2015-03-12
- 0.1.2 — 2015-01-08
- 0.1.1 — 2014-12-18
- 0.1.0 — 2014-12-18
- 0.0.12 — 2014-12-17
- 0.0.11 — 2014-12-16
- 0.0.10 — 2014-12-16
- 0.0.9 — 2014-12-15
- 0.0.8 — 2014-12-14
- 0.0.7 — 2014-12-13
- … 6 more at https://npm.io/package/sand-grain/versions

## README

[![Build Status](https://travis-ci.org/pocketly/sand-grain.svg?branch=master)](https://travis-ci.org/pocketly/sand-grain) [![npm version](https://badge.fury.io/js/sand-grain.svg)](http://badge.fury.io/js/sand-grain)

# Sand Base Grain/Module
All Grains (Modules) used by Sand must first extend this base grain.

## To begin

 1. Install it:

    ```bash
    $ npm install sand-grain -S
    ```
    

 2. Create a new module which extends SandGrain and implement `SandGrain.name` property, `SandGrain.init()` method and, optionally, `SandGrain.shutdown()`
	```javascript
	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
	});
	```

 3. Use your shiny new module with Sand
	```javascript
	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 &copy; 2014 Pocketly

---
_Source: https://npm.io/package/sand-grain · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
