
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
function-bootstrapper
Advanced tools
Example ES6:
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:
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);
Object
Object
Object
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
promise | Boolean | If false, it needs to be sync |
function | function | |
payload | * | The payload is the first arguement for the function |
ignoreError | Boolean | Don't reject if a error occurs, but only for this fragment |
pipeTo | function | This function will be executed after the main function finished. The first argument is the result of the function. |
Object
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
ignoreError | Boolean | Don't reject if a error occurs |
parallel | Boolean | Run Bootchain parallel, how much operation parallel is defined with limit. You only need to define one property, parallel or limit. If not limit is set and parallel is true, cpu core count will be used. |
limit | int | How much operation parallel. You only need to define one property, parallel or limit. If not limit is set and parallel is true, cpu core count will be used. |
chain | BootChainFragment | [] |
FAQs
A bootstrapper library
We found that function-bootstrapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.