write-any-file

Write to any file you want in any format.

Usage no npm install needed!

<script type="module">
  import writeAnyFile from 'https://cdn.skypack.dev/write-any-file';
</script>

README

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