{"_id":"@albanm/cfb","_rev":"1-c631092e18351625c28eb67ffd87a548","name":"@albanm/cfb","dist-tags":{"latest":"1.1.4"},"versions":{"1.1.4":{"name":"@albanm/cfb","version":"1.1.4","author":{"name":"sheetjs"},"description":"Compound File Binary File Format extractor","keywords":["cfb","compression","office"],"bin":{"cfb":"./bin/cfb.njs"},"main":"./cfb","types":"types","browser":{"node":false,"process":false,"fs":false},"dependencies":{"adler-32":"~1.2.0","commander":"^2.16.0","crc-32":"~1.2.0","printj":"~1.1.2"},"devDependencies":{"@sheetjs/uglify-js":"~2.7.3","@types/commander":"^2.9.0","@types/node":"^8.10.25","blanket":"~1.2.3","dtslint":"~0.1.2","mocha":"~2.5.3","typescript":"2.2.0"},"repository":{"type":"git","url":"git://github.com/SheetJS/js-cfb.git"},"scripts":{"pretest":"make init","test":"make test","dtslint":"dtslint types"},"config":{"blanket":{"pattern":"cfb.js"}},"homepage":"http://sheetjs.com/opensource","bugs":{"url":"https://github.com/SheetJS/js-cfb/issues"},"license":"Apache-2.0","engines":{"node":">=0.8"},"gitHead":"87230ad53eb68fa077f72ea3fdccde3535298d8b","_id":"@albanm/cfb@1.1.4","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-anSzDthmo9lS06swQ/1qrimPQzIdvUl1XDEDTVsTv6sgh9tgmrPTnivZFJektckoiTYAHo8P2/4cF5bsgKoR3A==","shasum":"25df2b9841850e7603f4ca3652a04aa969549636","tarball":"https://registry.npmjs.org/@albanm/cfb/-/cfb-1.1.4.tgz","fileCount":14,"unpackedSize":304798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdnzm1CRA9TVsSAnZWagAAIZUQAJAACowhB4tSED23qzdi\nAvzsa74OTDIcWKPhrrnkLHKl0oPc/PICzU8bAYEMFx/GBpvlSt7qgYwcTZWS\nUP1CIH0K6gfiUB26+e/RRVcJQQjjxyIijosz8CBPwCqq8TrOPOGpOgx5lMRq\nTegI7kkHh2pdUtCMm3quaogFRq37xPLhTickP/wYnNzfVfWj5gkhApwY29m9\n+U013v3tqYRSLUbWajtHCedaL/Z8sqg+zfuXpJBXcTCrBVleTJl3RpP6cjWh\nyF5N6/WdKw8YMQnJbIOARg3dZMv6fALz4DCxDiFczmeTvLk+p5EgsyWPgR4/\nkVJPC7OgaTjmMiO3k5rnDvV5Zkmlvx5cQj/+sJQzCaQwQBS4y6fKb3d9azlC\nozA6B1rOTyG4kI9QyiwMHcW6Eol8Oh6CA6UlvMTX85bl2Xe7ddiNTyKEN2zs\nkw2dL+j25QwpO54AtJD1Wv+KYSltzWEni5fWMuZIqhwh/M+0DIRs5z31eHqJ\npCft5nTzG2LtXqu+7IY9aHiuKyCEaJjbRQjfyPbsWiWljUw0zQ3XK7loElkW\nQ9WAGBukXjrCsbLnfHatIzNqWwJPGM76nFnFqAya4AHVKVBrzANy5ukMZGVL\nAXz7H+PyeSEZTPZcbIOaJjCVifqMZ6jvuycYCbPXY5UeBYSoj6j1Qiv3elhb\n/hnS\r\n=SipD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDTGXdvpQ1RHaZj7ZfhvmMa2pY1W5llfYzCzRI3wEeJjAiEAgF7Mzepf/hiwFmONp3Jd2534fG3mV2dXKPWzcDVURqQ="}]},"maintainers":[{"name":"albanm","email":"alban.mouton@gmail.com"}],"_npmUser":{"name":"albanm","email":"alban.mouton@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cfb_1.1.4_1570716084568_0.7941733173624712"},"_hasShrinkwrap":false}},"time":{"created":"2019-10-10T14:01:24.343Z","1.1.4":"2019-10-10T14:01:25.212Z","modified":"2022-04-04T12:34:23.246Z"},"maintainers":[{"name":"albanm","email":"alban.mouton@gmail.com"}],"description":"Compound File Binary File Format extractor","homepage":"http://sheetjs.com/opensource","keywords":["cfb","compression","office"],"repository":{"type":"git","url":"git://github.com/SheetJS/js-cfb.git"},"author":{"name":"sheetjs"},"bugs":{"url":"https://github.com/SheetJS/js-cfb/issues"},"license":"Apache-2.0","readme":"# Container File Blobs\n\nPure JS implementation of various container file formats, including ZIP and CFB.\n\n[![Build Status](https://travis-ci.org/SheetJS/js-cfb.svg?branch=master)](https://travis-ci.org/SheetJS/js-cfb)\n[![Coverage Status](http://img.shields.io/coveralls/SheetJS/js-cfb/master.svg)](https://coveralls.io/r/SheetJS/js-cfb?branch=master)\n[![Dependencies Status](https://david-dm.org/sheetjs/js-cfb/status.svg)](https://david-dm.org/sheetjs/js-cfb)\n[![NPM Downloads](https://img.shields.io/npm/dt/cfb.svg)](https://npmjs.org/package/cfb)\n[![Analytics](https://ga-beacon.appspot.com/UA-36810333-1/SheetJS/js-cfb?pixel)](https://github.com/SheetJS/js-cfb)\n\n## Installation\n\nIn the browser:\n\n```html\n<script src=\"dist/cfb.min.js\" type=\"text/javascript\"></script>\n```\n\nWith [npm](https://www.npmjs.org/package/cfb):\n\n```bash\n$ npm install cfb\n```\n\nThe `xlscfb.js` file is designed to be embedded in [js-xlsx](http://git.io/xlsx)\n\n\n## Library Usage\n\nIn node:\n\n```js\nvar CFB = require('cfb');\n```\n\nFor example, to get the Workbook content from an Excel 2003 XLS file:\n\n```js\nvar cfb = CFB.read(filename, {type: 'file'});\nvar workbook = CFB.find(cfb, 'Workbook');\nvar data = workbook.content;\n```\n\n\n## Command-Line Utility Usage\n\nIt is preferable to install the library globally with npm:\n\n```bash\n$ npm install -g cfb\n```\n\nThe global installation adds a command `cfb` which can work with files:\n\n- `cfb file [names...]` extracts the contents of the file.  If additional names\n  are supplied, only the listed files will be extracted.\n\n- `cfb -l file` lists the contained files (following `unzip -l` \"short format\")\n\n- `cfb -r file` attempts to repair by reading and re-writing the file.\n  This fixes some issues with files generated by non-standard tools.\n\n- `cfb -c file [files...]` creates a new file containing the listed files.\n  The default root entry name is `Root Entry`.\n\n- `cfb -a file [files...]` adds the listed files to the original file.\n\n- `cfb -d file [files...]` deletes the listed files from the original file.\n\n\n## JS API\n\nTypeScript definitions are maintained in `types/index.d.ts`.\n\nThe CFB object exposes the following methods and properties:\n\n`CFB.parse(blob)` takes a nodejs Buffer or an array of bytes and returns an\nparsed representation of the data.\n\n`CFB.read(blob, opts)` wraps `parse`.\n\n`CFB.find(cfb, path)` performs a case-insensitive match for the path (or file\nname, if there are no slashes) and returns an entry object or null if not found.\n\n`CFB.write(cfb, opts)` generates a file based on the container.\n\n`CFB.writeFile(cfb, filename, opts)` creates a file with the specified name.\n\n### Parse Options\n\n`CFB.read` takes an options argument.  `opts.type` controls the behavior:\n\n| `type`     | expected input                                                  |\n|------------|:----------------------------------------------------------------|\n| `\"base64\"` | string: Base64 encoding of the file                             |\n| `\"binary\"` | string: binary string (byte `n` is `data.charCodeAt(n)`)        |\n| `\"file\"`   | string: path of file that will be read (nodejs only)            |\n| (default)  | buffer or array of 8-bit unsigned int (byte `n` is `data[n]`)   |\n\n\n### Write Options\n\n`CFB.write` and `CFB.writeFile` take options argument.\n\n`opts.type` controls the behavior:\n\n| `type`     | output                                                          |\n|------------|:----------------------------------------------------------------|\n| `\"base64\"` | string: Base64 encoding of the file                             |\n| `\"binary\"` | string: binary string (byte `n` is `data.charCodeAt(n)`)        |\n| `\"file\"`   | string: path of file that will be created (nodejs only)         |\n| (default)  | buffer if available, array of 8-bit unsigned int otherwise      |\n\n`opts.fileType` controls the output file type:\n\n| `fileType`         | output        |\n|:-------------------|:--------------|\n| `'cfb'` (default)  | CFB container |\n| `'zip'`            | ZIP file      |\n\n`opts.compression` enables DEFLATE compression for ZIP file type.\n\n\n## Utility Functions\n\nThe utility functions are available in the `CFB.utils` object.  Functions that\naccept a `name` argument strictly deal with absolute file names:\n\n- `.cfb_new(?opts)` creates a new container object.\n- `.cfb_add(cfb, name, ?content, ?opts)` adds a new file to the `cfb`.\n  Set the option `{unsafe:true}` to skip existence checks (for bulk additions)\n- `.cfb_del(cfb, name)` deletes the specified file\n- `.cfb_mov(cfb, old_name, new_name)` moves the old file to new path and name\n- `.use_zlib(require(\"zlib\"))` loads a nodejs zlib instance.\n\nBy default, the library uses a pure JS inflate/deflate implementation.  NodeJS\n`zlib.InflateRaw` exposes the number of bytes read in versions after `8.11.0`.\nIf a supplied `zlib` does not support the required features, a warning will be\ndisplayed in the console and the pure JS fallback will be used.\n\n\n## Container Object Description\n\nThe objects returned by `parse` and `read` have the following properties:\n\n- `.FullPaths` is an array of the names of all of the streams (files) and\n  storages (directories) in the container.  The paths are properly prefixed from\n  the root entry (so the entries are unique)\n\n- `.FileIndex` is an array, in the same order as `.FullPaths`, whose values are\n  objects following the schema:\n\n```typescript\ninterface CFBEntry {\n  name: string; /** Case-sensitive internal name */\n  type: number; /** 1 = dir, 2 = file, 5 = root ; see [MS-CFB] 2.6.1 */\n  content: Buffer | number[] | Uint8Array; /** Raw Content */\n  ct?: Date; /** Creation Time */\n  mt?: Date; /** Modification Time */\n}\n```\n\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\n## References\n\n - [MS-CFB]: Compound File Binary File Format\n - ZIP `APPNOTE.TXT`: https://pkware.cachefly.net/webdocs/APPNOTE/APPNOTE-6.3.4.TXT\n - RFC1951: https://www.ietf.org/rfc/rfc1951.txt\n\n","readmeFilename":"README.md"}