0.1.2 • Published 5 years ago

write-any-file v0.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

Write Any File!

NPM version Build Status Test Coverage Dependency Status DevDependency Status License PR Welcome

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