Stackable Javascript Library
This is the Official Stackable API Javascript library for getting data from stacks.
Available and Support in both Browser
and NodeJs
.
Working examples are found in examples
directory!
In browser jQuery
is required.
Install
You can get it on npm
npm install stackable --save
Or bower, too.
bower install stackable --save
Include Stackable file in your project
Usage
Make sure to create an account at http://www.stackable.space and setup your Stack and Containers.
To initialize
var stackable = 'YOUR-STACK-PUBLIC-KEY-HERE';
To list all containers
stackable;
To get single containers
stackable;
To get all items within single container
stackable;
To get all items within stack
stackable;
To get single item
stackable;
To create new item
- First initialize, using PRIVATE KEY, (MAKE SURE YOU KEEP THIS KEY SAFE! MOSTLY ON SERVER SIDE)
var stackable = 'YOUR-STACK-PRIVATE-KEY-HERE';
var dataToPost = name: 'John Doe' age: 29; stackable;
To update an item
var dataToUpdate = name: 'John Doe' age: 29; stackable;
To build (development)
Sources files are located in src
directory
Run npm install to setup required libraries.
npm install
npm Scripts
npm test
- Lint the library and tests, then run the unit testsnpm run lint
- Lint the source and unit testsnpm run watch
- Continuously run the unit tests as you make changes to the source and test files themselvesnpm run test-browser
- Build the library for use with the browser spec runner. Changes to the source will cause the runner to automatically refresh.npm run build
- Lint then build the librarynpm run coverage
- Generate a coverage report
Todo
- Write tests.
- Test with Nodejs App
- Nodejs example