mk-anything

0.0.6 • Public • Published

descriptions

A tool to create files or folders via cli.

usage

  1. you can use it just installing mk-anything via npm or yarn
  2. config a file .mk.js in root directory(default used)
  3. run command mk

config example

.mk.js

const path = require('path')
module.exports = {
    root: path.join(__dirname, '/src'),
    paths: [
        {
            test: [
                'index.js',
                {
                    test: []
                }
            ],
            test2: [
                {
                    public: ['index.html']
                }
            ]
        },
        'test.js'
    ],
}

or

const path = require('path')
module.exports = {
    root: path.join(__dirname, '/src'), // base path
    template: path.join(__dirname, '/template'), // template path
    paths: [
        {
            // will create a directory in root path
            test: [
                // will create a file in test directory, 
                // name: index.js, content: index.js from tempalte directory
                {
                    name: 'index.js',
                    template: 'index.js'
                },
                {
                    test: [], // will create a directory in test directory
                    name: []  // will create a directoty in test directory
                },
                'utils.js' // will create a file , anme utils.js in test directory
            ],
            test2: [
                {
                    // will create directory, name: public
                    public: [
                      // will create a file in test directory, 
                      // name: index.html, content: index.html from tempalte directory
                        {name: 'index.html', template: 'index.html'}
                    ]
                }
            ]
        },
        'test.js' //will create a file, name test.js in root path
    ],
}

usage style

mk
mk -inject=dirname
mk .mk.another.js
// ignored the default config file .mk.js
mk .mk.another.js -inject=dirname
// ignored the default config file .mk.js

args

-inject: create directories or files in root + inject

Package Sidebar

Install

npm i mk-anything

Weekly Downloads

5

Version

0.0.6

License

ISC

Unpacked Size

6.84 kB

Total Files

6

Last publish

Collaborators

  • dk-bin