Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nisaacson/spinup-rebuild
Rebuild binary dependecies when starting your app
https://github.com/nisaacson/spinup-rebuild
Last synced: about 1 month ago
JSON representation
Rebuild binary dependecies when starting your app
- Host: GitHub
- URL: https://github.com/nisaacson/spinup-rebuild
- Owner: nisaacson
- Created: 2013-03-17T16:40:51.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-03-17T16:48:47.000Z (over 11 years ago)
- Last Synced: 2024-04-14T14:46:50.741Z (7 months ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spinup Rebuild
Rebuild binary dependecies when starting your app# Installation
```bash
npm install spinup-rebuild
```# Usage
var should = require('should')
var spinupRebuild = require('spinup-rebuild')
var inspect = require('eyespect').inspector()
rebuildAndStart(function(err) {
should.not.exist(err, 'error rebuilding and starting application: ' + JSON.stringify(err))
inspect('startup complete')
})
function rebuildAndStart(cb) {
spinupRebuild(function(err) {
if (err) { return cb(err) }
console.log('rebuild complete')
// now start the rest of your application which depends on binary modules// for example memwatch will only work if it has been compiled for your target platform
var memwatch = require('memwatch')
start(cb)
})/**
* Trivial startup function which just takes a heap dump and returns
* This is just meant to illustrate using a binary module which must be compiled before your app can fun
*/
function start(cb) {
var hd = new memwatch.HeapDiff();
var diff = hd.end();
inspect(diff, 'heap diff')
cb()
}