Charlike
Small, fast and streaming project scaffolder with support for hundreds of template engines (via @JSTransformers) and sane defaults
Install / Use
/learn @tunnckoCoreLabs/CharlikeREADME
charlike [![npm version][npmv-img]][npmv-url] [![github release][ghrelease-img]][ghrelease-url] [![License][license-img]][license-url]
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.
<div id="thetop"></div>[![Code style][codestyle-img]][codestyle-url] [![CircleCI linux build][linuxbuild-img]][linuxbuild-url] [![CodeCov coverage status][codecoverage-img]][codecoverage-url] [![DavidDM dependency status][dependencies-img]][dependencies-url] [![Renovate App Status][renovateapp-img]][renovateapp-url] [![Make A Pull Request][prs-welcome-img]][prs-welcome-url] [![Semantically Released][standard-release-img]][standard-release-url]
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][open-issue-url] or ping
@tunnckoCore at Twitter.
[![Become a Patron][patreon-img]][patreon-url] [![Conventional Commits][ccommits-img]][ccommits-url] [![Spectrum community][spectrum-community-img]][spectrum-community-url] [![NPM Downloads Monthly][downloads-monthly-img]][npmv-url] [![NPM Downloads Total][downloads-total-img]][npmv-url] [![Share Love Tweet][shareb]][shareu]
Project is semantically versioned & automatically released through CircleCI with [Standard Release][standard-release-url].
<!-- Logo when needed: <p align="center"> <a href="https://github.com/tunnckoCoreLabs/charlike"> <img src="./media/logo.png" width="85%"> </a> </p> -->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
<!-- docks-start -->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 isprojectwhich should be an objectsettings.cwd{object} working directory to create project to, defaults toprocess.cwd()settings.project{object} should containname,description,repoanddestsettings.locals{object} to pass more context to template filessettings.engine{string} for different template engine to be used in template files, default islodash
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!`));
<!-- docks-end -->
See Also
Some of these projects are used here or were inspiration for this one, others are just related. So, thanks for your existance!
- @tunnckocore/config: All the configs for all the tools, in one place | homepage
- @tunnckocore/create-project: Create and scaffold a new project, its GitHub repository and… more | homepage
- asia: Blazingly fast, magical and minimalist testing framework, for Today and… more | homepage
- docks: Extensible system for parsing and generating documentation. It just freaking… more | homepage
- git-commits-since: Get all commits since given period of time or by… more | homepage
- gitcommit: Lightweight and joyful
git commitreplacement. Conventional Commits compliant. | homepage - recommended-bump: Calculates recommended bump (next semver version) based on given array… more | homepage
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][spectrum-community-url] 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?][patreon-url] :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
