0.0.6 • Published 2 years ago

mk-anything v0.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

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

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago