🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

mkfile-cli

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mkfile-cli

A tool to help you quickly create file in project

latest
npmnpm
Version
1.0.7
Version published
Weekly downloads
1
-92.31%
Maintainers
1
Weekly downloads
 
Created
Source

mkfile-cli

A tool to help you quickly create file in project

install

npm i mkfile-cli

config

添加mk.json在项目的根目录,配置mk.json,dir为生成目标文件的路径,js为文件后缀名,tpl是文件模板路径。模板内容可以自定义,使用的模板语法是nunjucks

{
    "fileList" : [
        {"dir": "test/js", "suffix": "js", "tpl": "tpl/js.tpl"},
        {"dir": "test/css", "suffix": "css", "tpl": "tpl/css.tpl"}
    ],
    "activityList" : [
        {"dir": "activity/js", "suffix": "js", "tpl": "tpl/js.tpl"}
    ]
}

use

mk --new [filename] --key [keyname]
mk -n [filename] -k [keyname]

keyname对应mk.json中的key值,若不传,则默认为fileList

  • 运行mk --new hellomk会根据模板创建文件test/js/hellomk.js和test/css/hellomk.css,若无tpl参数,则创建空文件;
  • 运行mk --new hellomk --key activityList会根据模板创建文件activity/js/hellomk.js

FAQs

Package last updated on 30 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts