Skip to content

axetroy/stone

Repository files navigation

stone.js

Greenkeeper badge Build Status Dependency License Prettier Node npm version

build data stuck like a stone, Sturdy!

Usage

 npm install @axetroy/stone
import Stone from '@axetroy/stone';

const userInfo = new Stone({username:'axetroy'});

// back
userInfo.username = 'admin'; // it will throw an error.

// good
userInfo.set('username', 'admin');  // this is ok.

console.log(userInfo.username);   // print "admin"

API

.set(key:string,value:any):this

set a value.

.remove(key:string):this

remove a key

.subscribe(func:Function):Function

subscribe the stone change

.watch(key:string,func:Function):Function

watch specify key change, base on .subscribe

.keys():string[]

return the keys list you set

.values():any[]

return the values list you set

  • stringify():string

convert to string, base on JSON.stringify()

Contributing

git clone https://github.com/axetroy/stone.git
cd ./stone
yarn
yarn run dev

License

The MIT License

About

build data stuck like a stone, Sturdy!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published