Getting started

Install Protoblast using npm

npm install protoblast

Then require it in your javascript project


Protoblast will now have extended your native objects with new methods, and added a few new global classes like Deck, Iterator and Informer:

// Array.cast will be a new static function
Array.cast('string');>>> ['string']

// New methods will also be added
var arr = [1, 2, 3];
arr.sum();>>> 6

// You can also instantiate these new added classes
var i = new Informer();

Non-native modifying mode

If you want protoblast to leave your native objects alone (save for a few polyfills), you can also require the bound functions by passing the false value:

var Blast = require('protoblast')(false);

// `cast` will not be added to the Array class
Array.cast>>> undefined

// It will be available here
Blast.Bound.Array.cast>>> function cast(variable)

// Same for the methods
var arr = [1, 2, 3];
arr.sum>>> undefined

// Apply the bound method
Blast.Bound.Array.sum(arr);>>> 6