0.5.0 • Published 6 years ago

generator-generator-lib v0.5.0

Weekly downloads
6
License
MIT
Repository
-
Last release
6 years ago

file-genesis

Build Status

Install


yarn add file-genesis

Use


const path = require("path");
const { File } = require("file-genesis");
const gitignore = `
  .DS_Store
  node_modules
`;

file.create(path.join(__dirname, ".gitignore")).plain(gitignore);

Note: Prettier is used for formatting during creation


API


.plain(), .symlink(), .template()

This is used to specify the type and pass content

plain

File("/path/to/file.ext").plain("content");

symlink

File("/path/to/file.ext").symlink("/path/to/src", "/path/to/dest");

template

let variables = { replaceMe: "withThisValue" };
File("/path/to/file.ext").template("path/to/template.ext", variables);

Docs



Goals


  • consistent api for symlinks, plain UTF-8 files and templates
  • interoperable with content-genesis

Related