CLI refactor
* Moved cli to packages/ssf-cli * Modified bin in package.json files
This commit is contained in:
parent
885b27fda5
commit
15c017bc5b
13
bin/ssf.njs
13
bin/ssf.njs
@ -1,13 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
/* ssf.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
||||
/* eslint-env node */
|
||||
/* eslint no-console:0 */
|
||||
/*jshint node:true */
|
||||
var X = require('../');
|
||||
var argv = process.argv.slice(2);
|
||||
if(argv.length < 2 || argv[0] == "-h" || argv[0] == "--help") {
|
||||
console.error("usage: ssf <format> <value>");
|
||||
console.error("output: format_as_string|format_as_number|");
|
||||
process.exit(0);
|
||||
}
|
||||
console.log(X.format(argv[0],argv[1]) + "|" + X.format(argv[0],+(argv[1])) + "|");
|
@ -8,9 +8,6 @@
|
||||
"sprintf",
|
||||
"spreadsheet"
|
||||
],
|
||||
"bin": {
|
||||
"ssf": "./bin/ssf.njs"
|
||||
},
|
||||
"main": "./ssf",
|
||||
"types": "types",
|
||||
"dependencies": {
|
||||
|
1
packages/ssf-cli/.gitignore
vendored
Normal file
1
packages/ssf-cli/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
node_modules/
|
8
packages/ssf-cli/bin/ssf.njs
Executable file
8
packages/ssf-cli/bin/ssf.njs
Executable file
@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env node
|
||||
/* ssf.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
||||
/* eslint-env node */
|
||||
/* eslint no-console:0 */
|
||||
/*jshint node:true */
|
||||
var cli = require('../');
|
||||
|
||||
cli();
|
17
packages/ssf-cli/index.js
Normal file
17
packages/ssf-cli/index.js
Normal file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env node
|
||||
/* ssf.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
||||
/* eslint-env node */
|
||||
/* eslint no-console:0 */
|
||||
/*jshint node:true */
|
||||
var X = require('ssf');
|
||||
function run() {
|
||||
var argv = process.argv.slice(2);
|
||||
if (argv.length < 2 || argv[0] == "-h" || argv[0] == "--help") {
|
||||
console.error("usage: ssf <format> <value>");
|
||||
console.error("output: format_as_string|format_as_number|");
|
||||
process.exit(0);
|
||||
}
|
||||
console.log(X.format(argv[0], argv[1]) + "|" + X.format(argv[0], +(argv[1])) + "|");
|
||||
}
|
||||
|
||||
module.exports = run;
|
14
packages/ssf-cli/package.json
Normal file
14
packages/ssf-cli/package.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "ssf-cli",
|
||||
"version": "1.0.0",
|
||||
"description": "Command-line interface for ssf",
|
||||
"bin": {
|
||||
"ssf-cli": "./bin/ssf.njs"
|
||||
},
|
||||
"main": "index.js",
|
||||
"author": "Garrett Luu",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"ssf": "^0.11.1"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user