charlike
Small, fast and streaming project scaffolder with support for hundreds of template engines and sane defaults
Last updated 8 months ago by tunnckocore .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install charlike 
SYNC missed versions from official npm registry.

charlike npm version github release License

Small, fast and streaming project scaffolder with support for hundreds of template engines and sane defaults

Please consider following this project's author, Charlike Mike Reagent, and :star: the project to show your :heart: and support.

Code style CircleCI linux build CodeCov coverage status DavidDM dependency status Renovate App Status Make A Pull Request Semantically Released

If you have any how-to kind of questions, please read the Contributing Guide and Code of Conduct documents.
For bugs reports and feature requests, please create an issue or ping @tunnckoCore at Twitter.

Become a Patron Conventional Commits Spectrum community NPM Downloads Monthly NPM Downloads Total Share Love Tweet

Project is semantically versioned & automatically released through CircleCI with Standard Release.

Table of Contents

(TOC generated by verb using markdown-toc)

Install

This project requires Node.js ^8.10.0 || >=10.13.0 (see Support & Release Policy). Install it using yarn or npm.
We highly recommend to use Yarn when you think to contribute to this project.

$ yarn add charlike
# or globally
$ yarn global add charlike

CLI

Install it globally or locally and run charlike --help.

  Usage: charlike [name] [description] [flags]

  Common Flags:
    -h, --help                Display this help.
    -v, --version             Display current version.

  Flags:
    -n, --name                Project's name.
    -d, --desc                Project description, short for "--project.description".
    -o, --owner               Usually your GitHub username or organization.
    -t, --templates           Source templates directory.
    --engine                  Engine to be used in the template files.
    --locals                  Locals for the template files. Support dot notation.
    --locals.author.name      Project's author name.
    --locals.author.email     Project's author email. And so on.
    --project                 Project metadata like name, description
    --project.name            Project name.
    --project.description     Project description.
    --cwd                     Folder to be used as current working dir.
    --ly                      Shortcut for --locals.license.year (license start year).
    --ln                      Set --locals.license.name.

  Examples:
    charlike my-new-project --ly 2018 --ln MIT -o myOrg
    charlike --project.name foobar --locals.author 'John Snow'
    charlike foobar --locals.author.name 'John Snow'
    charlike foobar --locals.license 'Apache-2.0' --locals.foo bar
    charlike foobar 'This is description'
    charlike foobar --project.description 'Some description here'
    charlike foobar --desc 'Some description here'
    charlike foobar 'Awesome description' --owner tunnckoCoreLabs
    charlike --project.name qux --desc 'Yeah descr' --owner tunnckoCore

API

Generated using docks.

src/index.js

charlike

Generates a complete project using a set of templates.

You can define what "templates" files to be used by passing settings.templates, by default it uses ./templates folder from this repository root.

You can define project metadata in settings.project object, which should contain name, description properties and also can contain repo and dest. By default the destination folder is dynamically built from settings.cwd and settings.project.name, but this behavior can be changed. If settings.project.repo is passed, then it will be used instead of the settings.project.name.

To control the context of the templates, pass settings.locals. The default set of locals includes version string and project, author and license objects.

Params

  • settings {object} the only required is project which should be an object
  • settings.cwd {object} working directory to create project to, defaults to process.cwd()
  • settings.project {object} should contain name, description, repo and dest
  • settings.locals {object} to pass more context to template files
  • settings.engine {string} for different template engine to be used in template files, default is lodash

Returns

  • Promise<object> if successful, will resolve to object like { locals, project, dest, options }

Examples

import charlike from 'charlike';

const settings = {
  project: { name: 'foobar', description: 'Awesome project' },
  cwd: '/home/charlike/code',
  templates: '/home/charlike/config/.jsproject',
  locals: {
    foo: 'bar',
    // some helper
    toUpperCase: (val) => val.toUpperCase(),
  },
};

// the `dest` will be `/home/charlike/code/foobar`
charlike(settings)
  .then(({ dest }) => console.log(`Project generated to ${dest}`))
  .catch((err) => console.error(`Error occures: ${err.message}; Sorry!`));

back to top

See Also

Some of these projects are used here or were inspiration for this one, others are just related. So, thanks for your existance!

back to top

Contributing

Guides and Community

Please read the Contributing Guide and Code of Conduct documents for advices.

For bug reports and feature requests, please join our Spectrum community forum and open a thread there with prefixing the title of the thread with the name of the project if there's no separate channel for it.

Consider reading the Support and Release Policy guide if you are interested in what are the supported Node.js versions and how we proceed. In short, we support latest two even-numbered Node.js release lines.

Support the project

Become a Partner or Sponsor? :dollar: Check the Partner, Sponsor or Omega-level tiers! :tada: You can get your company logo, link & name on this file. It's also rendered on package page in npmjs.com and yarnpkg.com sites too! :rocket:

Not financial support? Okey! Pull requests, stars and all kind of contributions are always welcome. :sparkles:

OPEN Open Source

This project is following OPEN Open Source model

Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is built on collective efforts and it's not strongly guarded by its founders.

There are a few basic ground-rules for its contributors

  1. Any significant modifications must be subject to a pull request to get feedback from other contributors.
  2. Pull requests to get feedback are encouraged for any other trivial contributions, but are not required.
  3. Contributors should attempt to adhere to the prevailing code-style and development workflow.

Wonderful Contributors

Thanks to the hard work of these wonderful people this project is alive! It follows the all-contributors specification.
Don't hesitate to add yourself to that list if you have made any contribution! ;) See how, here.


Charlike Mike Reagent

???? ???? ???? ???? ????

Consider showing your support to them. :sparkling_heart:

License

Copyright (c) 2016-present, Charlike Mike Reagent <mameto2011@gmail.com> & contributors.
Released under the Apache-2.0 License.

Current Tags

  • 3.8.9                                ...           latest (8 months ago)
  • 3.0.0-beta.rc2                                ...           next (2 years ago)
  • 3.8.4-patch.1                                ...           patch (a year ago)

154 Versions

  • 3.8.9                                ...           8 months ago
  • 3.8.8                                ...           8 months ago
  • 3.8.7                                ...           8 months ago
  • 3.8.6                                ...           a year ago
  • 3.8.5                                ...           a year ago
  • 3.8.4-patch.1                                ...           a year ago
  • 3.8.4                                ...           2 years ago
  • 3.8.3                                ...           2 years ago
  • 3.8.2                                ...           2 years ago
  • 3.8.1                                ...           2 years ago
  • 3.8.0                                ...           2 years ago
  • 3.7.0                                ...           2 years ago
  • 3.6.1                                ...           2 years ago
  • 3.6.0                                ...           2 years ago
  • 3.5.0                                ...           2 years ago
  • 3.4.7                                ...           2 years ago
  • 3.4.6                                ...           2 years ago
  • 3.4.5                                ...           2 years ago
  • 3.4.4                                ...           2 years ago
  • 3.4.3                                ...           2 years ago
  • 3.4.2                                ...           2 years ago
  • 3.4.1                                ...           2 years ago
  • 3.4.0                                ...           2 years ago
  • 3.3.0                                ...           2 years ago
  • 3.2.0                                ...           2 years ago
  • 3.1.11                                ...           2 years ago
  • 3.1.10                                ...           2 years ago
  • 3.1.9                                ...           2 years ago
  • 3.1.8                                ...           2 years ago
  • 3.1.7                                ...           2 years ago
  • 3.1.6                                ...           2 years ago
  • 3.1.5                                ...           2 years ago
  • 3.1.4                                ...           2 years ago
  • 3.1.3                                ...           2 years ago
  • 3.1.2                                ...           2 years ago
  • 3.1.1                                ...           2 years ago
  • 3.1.0                                ...           2 years ago
  • 3.0.2                                ...           2 years ago
  • 3.0.1                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
  • 3.0.0-beta.rc2                                ...           2 years ago
  • 3.0.0-beta                                ...           2 years ago
  • 2.1.2                                ...           2 years ago
  • 2.1.1                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.11                                ...           2 years ago
  • 2.0.10                                ...           2 years ago
  • 2.0.9                                ...           2 years ago
  • 2.0.8                                ...           2 years ago
  • 2.0.7                                ...           2 years ago
  • 2.0.6                                ...           2 years ago
  • 2.0.5                                ...           2 years ago
  • 2.0.4                                ...           2 years ago
  • 2.0.3                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.11.5                                ...           2 years ago
  • 1.11.4                                ...           2 years ago
  • 1.11.3                                ...           2 years ago
  • 1.11.2                                ...           2 years ago
  • 1.11.1                                ...           2 years ago
  • 1.11.0                                ...           2 years ago
  • 1.10.0                                ...           2 years ago
  • 1.9.1                                ...           2 years ago
  • 1.9.0                                ...           2 years ago
  • 1.8.1                                ...           2 years ago
  • 1.7.7                                ...           2 years ago
  • 1.7.6                                ...           2 years ago
  • 1.7.5                                ...           2 years ago
  • 1.7.4                                ...           2 years ago
  • 1.7.3                                ...           2 years ago
  • 1.7.2                                ...           2 years ago
  • 1.7.1                                ...           2 years ago
  • 1.7.0                                ...           2 years ago
  • 1.6.0                                ...           2 years ago
  • 1.5.3                                ...           2 years ago
  • 1.5.2                                ...           2 years ago
  • 1.5.1                                ...           2 years ago
  • 1.5.0                                ...           2 years ago
  • 1.3.2                                ...           2 years ago
  • 1.3.1                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.26                                ...           2 years ago
  • 1.0.25                                ...           2 years ago
  • 1.0.24                                ...           2 years ago
  • 1.0.23                                ...           2 years ago
  • 1.0.22                                ...           2 years ago
  • 1.0.21                                ...           2 years ago
  • 1.0.20                                ...           2 years ago
  • 1.0.19                                ...           2 years ago
  • 1.0.18                                ...           2 years ago
  • 1.0.17                                ...           2 years ago
  • 1.0.16                                ...           2 years ago
  • 1.0.15                                ...           2 years ago
  • 1.0.14                                ...           2 years ago
  • 1.0.13                                ...           2 years ago
  • 1.0.12                                ...           2 years ago
  • 1.0.11                                ...           2 years ago
  • 1.0.10                                ...           2 years ago
  • 1.0.9                                ...           2 years ago
  • 1.0.8                                ...           2 years ago
  • 1.0.7                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.3.23                                ...           3 years ago
  • 0.3.22                                ...           3 years ago
  • 0.3.21                                ...           3 years ago
  • 0.3.20                                ...           3 years ago
  • 0.3.19                                ...           3 years ago
  • 0.3.18                                ...           3 years ago
  • 0.3.17                                ...           3 years ago
  • 0.3.16                                ...           3 years ago
  • 0.3.15                                ...           3 years ago
  • 0.3.14                                ...           3 years ago
  • 0.3.13                                ...           3 years ago
  • 0.3.12                                ...           3 years ago
  • 0.3.11                                ...           3 years ago
  • 0.3.10                                ...           3 years ago
  • 0.3.9                                ...           3 years ago
  • 0.3.8                                ...           3 years ago
  • 0.3.7                                ...           3 years ago
  • 0.3.6                                ...           3 years ago
  • 0.3.5                                ...           3 years ago
  • 0.3.4                                ...           3 years ago
  • 0.3.3                                ...           3 years ago
  • 0.3.2                                ...           3 years ago
  • 0.3.1                                ...           3 years ago
  • 0.3.0                                ...           3 years ago
  • 0.2.14                                ...           3 years ago
  • 0.2.13                                ...           3 years ago
  • 0.2.12                                ...           3 years ago
  • 0.2.11                                ...           3 years ago
  • 0.2.10                                ...           3 years ago
  • 0.2.9                                ...           3 years ago
  • 0.2.8                                ...           3 years ago
  • 0.2.7                                ...           3 years ago
  • 0.2.6                                ...           3 years ago
  • 0.2.5                                ...           3 years ago
  • 0.2.4                                ...           3 years ago
  • 0.2.3                                ...           3 years ago
  • 0.2.2                                ...           3 years ago
  • 0.2.1                                ...           3 years ago
  • 0.2.0                                ...           4 years ago
  • 0.1.1                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
  • 0.0.0                                ...           4 years ago
Maintainers (2)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 462
Dependencies (13)
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |