yoso
[中文文档](./README_zh.md)
Last updated a year ago by jovilin .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install yoso 
SYNC missed versions from official npm registry.

YOSOnpm

中文文档

This is a command line tool that automatically generates files from custom templates. You only need to set it once before you can reuse it.

Install

$ npm install -g yoso

Usage

First use

Write your own template file before using it for the first time. Here is the template engine used is nunjucks, related syntax reference nunjucks official website.You can put multiple template files in a folder with a certain file structure, or you can put a single file. Use the suffix you want for the template file. For Example

component
├── component.html
├── component.js
├── component.scss
└── ui.js
vue-ts.vue
vuex.ts

To load template files from the git repository, you need to set up the git repository information first.

  • Need username, repository name, branch name (default master), token (not required, but github limits requests to 60 requests per hour for unauthenticated requests) for github.
  • Need gitlab address, repo id, branch, token(required) for gitlab. If the repo id is not clear, it can be searched by entering the repo name; if there is any repo has the same name, enter name with namespace.
$ yoso config

Generate files

  1. Load the template locally
$ yoso new [options] <tpl> <path>

For example

$ yoso new vuex src/store/demo 

Optional argments

Options
  -o, --others Add custom fields
  1. Load the template from the github repository

The GUI operation interface can be easily evoked by yoso init. The configuration at this time is to read the setting parameters in yoso config:

You can also specify parameters to customize the operation:

$ yoso init [options] <tpl> [path]

For example

$ yoso init vuex src/store/demo

Optional argments

Options
  -b, --branch <branch> edit branch
  -u, --username <username> edit username
  -r, --repo <repo> edit repo
  -o, --others Add custom fields

You can use the command line option -o or --others to add custom fields, and inserted into the corresponding position in the template. The default fields include:

{
  name,//From the input path
  author,//From the git config
  email,//From the git config
}

The input format iskey value, separated by one or more Spaces, and the leading and trailing Spaces are cleared by default. You can override the default field with a custom field of the same name.

Current Tags

  • 1.2.3                                ...           latest (a year ago)

19 Versions

  • 1.2.3                                ...           a year ago
  • 1.2.2                                ...           a year ago
  • 1.2.1                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.6                                ...           a year ago
  • 1.1.5                                ...           a year ago
  • 1.1.4                                ...           a year ago
  • 1.1.3                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.0                                ...           a year ago
  • 0.1.7                                ...           a year ago
  • 0.1.5                                ...           a year ago
  • 0.1.4                                ...           a year ago
  • 0.1.3                                ...           a year ago
  • 0.1.2                                ...           a year ago
  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 19
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (35)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |