mk-anything
v0.0.6
Published
via cli create directories and sub directories or files
Downloads
2
Readme
descriptions
A tool to create files or folders via cli.
usage
- you can use it just installing
mk-anything
vianpm
oryarn
- config a file
.mk.js
in root directory(default used) - 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