https://github.com/bin-huang/apjson
append json file in correct format and more easy
https://github.com/bin-huang/apjson
Last synced: 6 months ago
JSON representation
append json file in correct format and more easy
- Host: GitHub
- URL: https://github.com/bin-huang/apjson
- Owner: Bin-Huang
- License: mit
- Created: 2017-05-14T13:38:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-15T02:46:56.000Z (over 8 years ago)
- Last Synced: 2025-03-28T18:51:02.819Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 481 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# why?
# install
```
npm install apjson
```# how to use?
```javascript
const Apjson = require("apjson");
const jsonFile = new Apjson("example.json");jsonFile.append({title: "hello, world"});
jsonFile.append({
title: "test1",
time: "20:49",
});jsonFile.close();
```## new Apjson(path, [space])
| parameter | type | default |
| -- | -- | -- |
| path | string | null |
| space | number | 2 |## Apjson.prototype.append(item)
| parameter | type |
| -- | -- |
| item | object |append stringified object
## Apjson.prototype.close()
when you are not adding more, close the writable stream.