@axetroy/stone

0.1.0 • Public • Published

stone.js

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

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i @axetroy/stone

    Weekly Downloads

    1

    Version

    0.1.0

    License

    ISC

    Last publish

    Collaborators

    • axetroy