{"name":"ssf","version":"0.6.2","author":{"name":"SheetJS"},"description":"pure-JS library to format data using ECMA-376 spreadsheet Format Codes","keywords":["format","sprintf","spreadsheet"],"main":"ssf.js","dependencies":{"voc":"","colors":"","frac":"0.3.1"},"devDependencies":{"mocha":""},"repository":{"type":"git","url":"git://github.com/SheetJS/ssf.git"},"scripts":{"test":"mocha -R spec"},"bin":{"ssf":"./bin/ssf.njs"},"config":{"blanket":{"pattern":"ssf.js"}},"bugs":{"url":"https://github.com/SheetJS/ssf/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"homepage":"https://github.com/SheetJS/ssf","_id":"ssf@0.6.2","dist":{"shasum":"0de10c3a2a89f2e36ae5dc06287d69ef346fa442","tarball":"http://registry-npm.ywwl.com/ssf/download/ssf-0.6.2.tgz","integrity":"sha512-dAQ9uS9Zxrq13iDsoR7zGLc1qHMhVNgWMKPtjgzTxwcjJd3Uptr5Xy19C0xjQdsE29lf8GTK0SHv4E+nCc/SRA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDANYX3d3WI7SnmRi94a0Sbp42WhijEdz+fLMFS90K3zQIhAO8bSdY04zBa7X+cS26f6wPH8diK4HYzctzpP7fFT+po"}],"size":31396,"noattachment":false,"key":"/ssf/-/ssf-0.6.2.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"sheetjs","email":"dev@sheetjs.com"},"maintainers":[{"name":"sheetjs","email":"sheetjs@gmail.com"}],"directories":{},"readme":"# [SheetJS SSF](http://sheetjs.com)\n\nssf (SpreadSheet Format) is a pure JS library to format data using ECMA-376\nspreadsheet format codes (used in popular spreadsheet software packages).\n\nThis is the community version.  We also offer a pro version with additional\nfeatures like international support as well as dedicated support.\n\n## Installation\n\nWith [npm](https://www.npmjs.org/package/ssf):\n\n```bash\n$ npm install ssf\n```\n\nIn the browser:\n\n```html\n<script src=\"ssf.js\"></script>\n```\n\nThe browser exposes a variable `SSF`\n\nWhen installed globally, npm installs a script `ssf` that renders the format\nstring with the given arguments.  Running the script with `-h` displays help.\n\nThe script will manipulate `module.exports` if available .  This is not always\ndesirable.  To prevent the behavior, define `DO_NOT_EXPORT_SSF`.\n\n## Usage\n\n`SSF.format(fmt, val, opts)` formats `val` using the format `fmt`.\n\nIf `fmt` is a string, it will be parsed and evaluated.  If `fmt` is a `number`,\nthe actual format will be the corresponding entry in the internal format table.\nFor a raw numeric format like `000`, the value should be passed as a string.\n\nDate arguments are interpreted in the local time of the JS client.\n\nThe options argument may contain the following keys:\n\n| Option Name | Default | Description                                          |\n| :---------- | :-----: | :--------------------------------------------------- |\n| `date1904`  | false   | Use 1904 date system if true, 1900 system if false   |\n\n### Manipulating the Internal Format Table\n\nBinary spreadsheet formats store cell formats in a table and reference by index.\nThis library uses a global table:\n\n`SSF._table` is the underlying object, mapping numeric keys to format strings.\n\n`SSF.load(fmt:string, idx:?number):number` assigns the format to the specified\nindex and returns the index.  If the index is not specified, SSF will search the\nspace for an available format slot pick an unused slot.  For compatibility with\nthe XLS and XLSB file formats, custom indices should be in the valid ranges\n`5-8`, `23-26`, `41-44`, `63-66`, `164-382` (see `[MS-XLSB] 2.4.655 BrtFmt`)\n\n`SSF.get_table()` gets the internal format table (number to format mapping).\n\n`SSF.load_table(table)` sets the internal format table.\n\n### Other Utilities\n\n`SSF.parse_date_code(val:number, opts:?any)` parses `val`, returning an object:\n\n```typescript\ntype SSFDate = {\n  D:number; /* number of whole days since relevant epoch, 0 <= D */\n  y:number; /* integral year portion, epoch_year <= y */\n  m:number; /* integral month portion, 1 <= m <= 12 */\n  d:number; /* integral day portion, subject to gregorian YMD constraints */\n  q:number; /* integral day of week (0=Sunday .. 6=Saturday) 0 <= q <= 6 */\n\n  T:number; /* number of seconds since midnight, 0 <= T < 86400 */\n  H:number; /* integral number of hours since midnight, 0 <= H < 24 */\n  M:number; /* integral number of minutes since the last hour, 0 <= M < 60 */\n  S:number; /* integral number of seconds since the last minute, 0 <= S < 60 */\n  u:number; /* sub-second part of time, 0 <= u < 1 */\n}\n```\n\n`SSF.is_date(fmt:string):boolean` returns `true` if `fmt` encodes a date format.\n\n## Examples\n\n- [Basic Demo](http://oss.sheetjs.com/ssf/)\n- [Custom Formats Builder](https://customformats.com)\n\n## Related Packages\n\n[`ssf-cli`](https://www.npmjs.com/package/ssf-cli) is a simple NodeJS command\nline tool for formatting numbers.\n\n## License\n\nPlease consult the attached LICENSE file for details.  All rights not explicitly\ngranted by the Apache 2.0 license are reserved by the Original Author.\n\n## References\n\n - `ECMA-376`: Office Open XML File Formats\n - `MS-XLS`: Excel Binary File Format (.xls) Structure Specification\n - `MS-XLSB`: Excel (.xlsb) Binary File Format\n\n## Badges\n\n[![Sauce Test Status](https://saucelabs.com/browser-matrix/ssfjs.svg)](https://saucelabs.com/u/ssfjs)\n\n[![Build Status](https://travis-ci.org/SheetJS/ssf.svg?branch=master)](https://travis-ci.org/SheetJS/ssf)\n\n[![Coverage Status](http://img.shields.io/coveralls/SheetJS/ssf/master.svg)](https://coveralls.io/r/SheetJS/ssf?branch=master)\n\n[![NPM Downloads](https://img.shields.io/npm/dt/ssf.svg)](https://npmjs.org/package/ssf)\n\n[![Dependencies Status](https://david-dm.org/sheetjs/ssf/status.svg)](https://david-dm.org/sheetjs/ssf)\n\n[![Analytics](https://ga-beacon.appspot.com/UA-36810333-1/SheetJS/ssf?pixel)](https://github.com/SheetJS/ssf)\n","publish_time":1396086392777,"_cnpm_publish_time":1396086392777,"dist-tags":{"latest":"0.11.2"}}