https://github.com/delucis/write-nextstep-plist
:floppy_disk: Stringify and write a NeXTSTEP property list atomically
https://github.com/delucis/write-nextstep-plist
nextstep plist
Last synced: about 2 months ago
JSON representation
:floppy_disk: Stringify and write a NeXTSTEP property list atomically
- Host: GitHub
- URL: https://github.com/delucis/write-nextstep-plist
- Owner: delucis
- License: gpl-3.0
- Created: 2018-04-19T22:59:33.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-16T21:55:11.000Z (almost 6 years ago)
- Last Synced: 2025-03-18T14:43:46.819Z (2 months ago)
- Topics: nextstep, plist
- Language: JavaScript
- Homepage:
- Size: 171 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# write-nextstep-plist [](https://travis-ci.org/delucis/write-nextstep-plist) [](https://coveralls.io/github/delucis/write-nextstep-plist?branch=master)
> Stringify and write a NeXTSTEP property list [atomically](https://github.com/npm/write-file-atomic)
Converts a Javascript object into a property list string in the NeXTSTEP “plain text” format and writes it to disk. Creates directories for you as needed.
**N.B.** The NeXTSTEP format is different from both the XML and JSON plist formats.
## Install
```
$ npm install --save write-nextstep-plist
```## Usage
```js
const WRITE_PLIST = require('write-nextstep-plist')WRITE_PLIST('demo.plist', {demo: true}).then(() => {
console.log('done')
})
```## API
### writeNextstepPlist(filepath, data, [options])
Returns a `Promise`.
### writeNextstepPlist.sync(filepath, data, [options])
```js
const WRITE_PLIST = require('write-nextstep-plist')WRITE_PLIST.sync('demo.plist', {demo: true})
console.log('done')
```#### options
Type: `Object`
##### mode
Type: `number`
Default: `0o666`[Mode](https://en.wikipedia.org/wiki/File_system_permissions#Numeric_notation) used when writing the file.
## See also
- [load-nextstep-plist](https://github.com/delucis/load-nextstep-plist) - Read and parse a NeXTSTEP property list file
## Acknowledgements
Stringifying is accomplished using Chee’s [`nextstep-plist`](https://www.npmjs.com/package/nextstep-plist) module.
This module is modelled on Sindre Sorhus’s [`write-json-file`](https://github.com/sindresorhus/write-json-file).
## License
This software is free to use, modify, and redistribute under a [GNU General Public License](http://www.gnu.org/licenses/gpl-3.0.txt).