genfile
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

genFile

Generate File

Installation

npm install genfile --save-dev
# or
yarn add genfile --dev

Usage

// import genFile from 'genfile';
const genFile = require('genfile');

// { filename, template, path? = '', update? = false }
genFile({
  filename: 'test.txt', // filename
  template: 'test genFile', // file content(object | string)
  // path: 'test/a/b', // file path
  // update: true, // update file content
})

Promise.all([
  genFile({
    filename: './test/file/a.txt',
    template: 'test a',
  }),
  genFile({
    filename: './test/file/b.txt',
    template: 'test b',
  })
]).then(state => console.info(state));

Tip:

  • Optional parameter: path, update
  • default value: path = '', update = false

Package Sidebar

Install

npm i genfile

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

8.73 kB

Total Files

7

Last publish

Collaborators

  • l8n