add README
This commit is contained in:
parent
04ba9253f4
commit
9f7c7a1462
@ -1,3 +1,4 @@
|
||||
# gitzone standard
|
||||
image: hosttoday/ht-docker-node:npmts
|
||||
|
||||
stages:
|
||||
@ -10,6 +11,7 @@ testLEGACY:
|
||||
stage: test
|
||||
script:
|
||||
- npmci test legacy
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
allow_failure: true
|
||||
@ -18,6 +20,7 @@ testLTS:
|
||||
stage: test
|
||||
script:
|
||||
- npmci test lts
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
@ -25,6 +28,7 @@ testSTABLE:
|
||||
stage: test
|
||||
script:
|
||||
- npmci test stable
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
|
51
README.md
Normal file
51
README.md
Normal file
@ -0,0 +1,51 @@
|
||||
# smartjson
|
||||
typed json handlers
|
||||
|
||||
## Availabililty
|
||||
[](https://www.npmjs.com/package/smartjson)
|
||||
[](https://GitLab.com/pushrocks/smartjson)
|
||||
[](https://github.com/pushrocks/smartjson)
|
||||
[](https://pushrocks.gitlab.io/smartjson/)
|
||||
|
||||
## Status for master
|
||||
[](https://GitLab.com/pushrocks/smartjson/commits/master)
|
||||
[](https://GitLab.com/pushrocks/smartjson/commits/master)
|
||||
[](https://www.npmjs.com/package/smartjson)
|
||||
[](https://david-dm.org/pushrocks/smartjson)
|
||||
[](https://www.bithound.io/github/pushrocks/smartjson/master/dependencies/npm)
|
||||
[](https://www.bithound.io/github/pushrocks/smartjson)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](http://standardjs.com/)
|
||||
|
||||
## Usage
|
||||
Use TypeScript for best in class instellisense.
|
||||
|
||||
### Classes
|
||||
SmartJson makes it easy to fold and enfold classes into and from JSON
|
||||
|
||||
```javascript
|
||||
import { Foldable, foldDec } from 'smartjson'
|
||||
|
||||
class AwesomeClass extends Foldable {
|
||||
computedValue: string
|
||||
|
||||
@foldDec() // mark anotherValueToStore as foldable
|
||||
anotherValueToStore: string = null
|
||||
constructor () {
|
||||
super() // this is important
|
||||
}
|
||||
}
|
||||
|
||||
let myAwesomeInstance = new AwesomeClass()
|
||||
let foldedObject = myAwesomeInstance.foldToObject() // will return {anotherValueToStore: null}
|
||||
myAwesomeInstance.enfoldFromObject({anotherValueToStore: 'hi'})
|
||||
foldedObject = myAwesomeInstance.foldToObject() // will return {anotherValueToStore: 'hi'}
|
||||
```
|
||||
|
||||
For further information read the linked docs at the top of this README.
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||
|
||||
[](https://push.rocks)
|
Loading…
x
Reference in New Issue
Block a user