write-any-file
v0.1.2
Published
Write to any file you want in any format.
Downloads
15
Readme
Write Any File!
Write to any file you want in any format.
Design Philosophy
This is a handy tool for save user configuration files in user's preferred format. Use with Load Any File! for better coding experience.
Installation
npm i write-any-file -s
Usage
To write to a file asynchronously:
await writeFile(data, '/home/john/config.json');
await writeFile(data, '/home/john/config.coffee');
await writeFile(data, '/home/john/config.yaml');
To write to a file synchronously:
writeFile.sync(data, '/home/john/config.json');
writeFile.sync(data, '/home/john/config.coffee');
writeFile.sync(data, '/home/john/config.yaml');
API
writeFile(data: any, location: string): Promise;
Write data
to location
asynchronously.
writeFile.sync(data: any, location: string): void;
Write data
to location
synchronously.
Change Log
- 0.1.0 (2019-05-23)
- basic functionality
License
MIT © Zhang Kai Yu