New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

function-bootstrapper

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

function-bootstrapper - npm Package Compare versions

Comparing version

to
1.3.0

2

package.json
{
"name": "function-bootstrapper",
"version": "1.2.1",
"version": "1.3.0",
"description": "A bootstrapper library",

@@ -5,0 +5,0 @@ "main": "dist/bundle.js",

# Bootstrapper
[![Build Status](https://travis-ci.org/TN-TN/Bootstrapper.svg?branch=master)](https://travis-ci.org/TN-TN/Bootstrapper)
[![Travis](https://img.shields.io/travis/TN-TN/Bootstrapper.svg?style=flat-square)](https://travis-ci.org/TN-TN/Bootstrapper)
[![npm](https://img.shields.io/npm/v/function-bootstrapper.svg?style=flat-square)](https://www.npmjs.com/package/function-bootstrapper)
A bootstrapper library
Example ES6:
```javascript
import Bootstrapper from 'function-bootstrapper';
import Promise from 'bluebird';
const bootstrap = new Bootstrapper({
ignoreError: true,
chain: [
{
promise: true,
payload: {
"importantData": "Hello"
},
function: function(payload) {
return new Promise((resolve, reject) => {
doSomething(payload, (error) => {
if (error){
reject(error);
} else {
resolve();
}
});
});
}
},
{
payload: '{"json":true}',
function: function(payload){
return JSON.parse(payload);
}
}
]
});
bootstrap.on('progress',console.log);
bootstrap.promise.then(() => {
console.log("Finished bootstrap");
}).catch(console.error);
```
Example normal:
```javascript
const Bootstrapper = require('function-bootstrapper');
const Promise = require('bluebird');
const bootstrap = new Bootstrapper({
ignoreError: true,
chain: [
{
promise: true,
payload: {
"importantData": "Hello"
},
function: function(payload) {
return new Promise(function (resolve, reject) {
doSomething(payload, (error) => {
if (error){
reject(error);
} else {
resolve();
}
});
});
}
},
{
payload: '{"json":true}',
function: function(payload){
return JSON.parse(payload);
}
}
]
});
bootstrap.on('progress',console.log);
bootstrap.promise.then(function () {
console.log("Finished bootstrap");
}).catch(console.error);
```
## Typedefs

@@ -7,0 +88,0 @@