generator-generator-lib

Generate raw assets for other generators

deprecated; see file-genesis
Last updated 2 years ago by alechp .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install generator-generator-lib 
SYNC missed versions from official npm registry.

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


Current Tags

  • 0.5.0                                ...           latest (2 years ago)

1 Versions

  • 0.5.0 [deprecated]           ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 2
Dependencies (6)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |