-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
577070b
commit 6cdd7ac
Showing
4 changed files
with
79 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# [SSF Command-Line Interface](http://sheetjs.com) | ||
|
||
ssf (SpreadSheet Format) is a pure JS library to format data using ECMA-376 | ||
spreadsheet format codes (used in popular spreadsheet software packages). | ||
|
||
This CLI tool formats numbers from shell scripts and other command-line tools. | ||
|
||
## Installation | ||
|
||
With [npm](https://www.npmjs.org/package/ssf-cli): | ||
|
||
```bash | ||
$ npm install -g ssf-cli | ||
``` | ||
|
||
## Usage | ||
|
||
`ssf-cli` takes two arguments: the format string and the value to be formatted. | ||
|
||
The value is formatted twice, once interpreting the value as a string and once | ||
interpreting the value as a number, and both results are printed to standard | ||
output, with a pipe character `|` after each value: | ||
|
||
```bash | ||
$ bin/ssf.njs "#,##0.00" 12345 | ||
12345|12,345.00| | ||
$ bin/ssf.njs "0;0;0;:@:" 12345 | ||
:12345:|12345| | ||
``` | ||
|
||
Extracting the values in a pipeline is straightforward with AWK: | ||
|
||
```bash | ||
$ bin/ssf.njs "#,##0.00" 12345 | awk -F\| '{print $2}' | ||
12,345.00 | ||
``` | ||
|
||
## License | ||
|
||
Please consult the attached LICENSE file for details. All rights not explicitly | ||
granted by the Apache 2.0 license are reserved by the Original Author. | ||
|
||
## Credits | ||
|
||
Special thanks to [Garrett Luu](https://garrettluu.com/) for spinning off the | ||
command from the SSF module. | ||
|
||
[![Analytics](https://ga-beacon.appspot.com/UA-36810333-1/SheetJS/ssf?pixel)](https://github.com/SheetJS/ssf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
{ | ||
"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" | ||
} | ||
"name": "ssf-cli", | ||
"version": "1.1.0", | ||
"author": "Garrett Luu", | ||
"description": "Command-line interface for ssf", | ||
"keywords": [ | ||
"format", | ||
"sprintf", | ||
"spreadsheet" | ||
], | ||
"main": "./index.js", | ||
"bin": { | ||
"ssf-cli": "./bin/ssf.njs" | ||
}, | ||
"dependencies": { | ||
"ssf": "^0.11.2" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/SheetJS/ssf.git" | ||
}, | ||
"homepage": "http://sheetjs.com/", | ||
"bugs": { | ||
"url": "https://github.com/SheetJS/ssf/issues" | ||
}, | ||
"license": "Apache-2.0", | ||
"engines": { | ||
"node": ">=0.8" | ||
} | ||
} |