https://github.com/axetroy/stone
build data stuck like a stone, Sturdy!
https://github.com/axetroy/stone
axetroy data stone stuck
Last synced: 12 days ago
JSON representation
build data stuck like a stone, Sturdy!
- Host: GitHub
- URL: https://github.com/axetroy/stone
- Owner: axetroy
- License: mit
- Created: 2017-05-11T04:01:20.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-08T12:41:46.000Z (over 6 years ago)
- Last Synced: 2025-05-27T02:41:51.372Z (about 2 months ago)
- Topics: axetroy, data, stone, stuck
- Language: JavaScript
- Homepage:
- Size: 101 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: contributing.md
- License: LICENSE
Awesome Lists containing this project
README
## stone.js
[](https://greenkeeper.io/)
[](https://travis-ci.org/axetroy/stone)
[](https://david-dm.org/axetroy/stone)

[](https://github.com/prettier/prettier)

[](https://badge.fury.io/js/@axetroy/stone)
build data stuck like a stone, Sturdy!
## Usage```bash
npm install @axetroy/stone
```
```javascript
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
```bash
git clone https://github.com/axetroy/stone.git
cd ./stone
yarn
yarn run dev
```## License
The [MIT License](https://github.com/axetroy/stone/blob/master/LICENSE)