In project:
npm i --dev snippetparse
In global:
npm i -g snippetparse
Maxos or Linux:
sudo npm i -g snippetparse
- import package
// cmd
$ npm i --dev snippetparse
// import package
const { snippetparse } = require('snippetparse')
// basic process.cwd()
let filePath = 'test/appo.vue'
// handle function
snippetparse(filePath)
- CLI
// npm
$ npm i -g snippetparse
$ snippetparse -f test/appo.vue
or
$ spar -f test/appo.vue
=>code:
let filePath = 'test/appo.vue'
snippetparse(filePath)
=>result-file:
/project
- /test
--appo.vue
++appo.vue.snippet
....
$ snippetparse -f test/appo.vue -of ./mysnippet
or
$ spar -f test/appo.vue -of ./mysnippet
=>code:
let filePath = 'test/appo.vue'
let outFilePath = 'mysnippet'
snippetparse(filePath)
=>result-file:
/project
- /test
--appo.vue
- mysnippet.snippet
// cmd
$ spar(short cmd) -f <filepath> -of <outfilepath>
$ snippetparse -f <filepath> -of <outfilepath>
- import package
// cmd
$ cd node_modules/snippetparse
$ npm run test
- CLI
// cmd
$ npm i -g snippetparse
$ cd node_modules/snippetparse
$ spar -f test/appo.vue
- [x] support CLI
Copyright © 2018-2019 hechengcheng.com
MIT