{"_id":"@electron/asar","_rev":"217125","name":"@electron/asar","description":"Creating Electron app packages","dist-tags":{"latest":"3.2.3"},"maintainers":[{"name":"electron-cfa","email":""}],"time":{"modified":"2023-03-24T09:13:42.000Z","created":"2022-10-18T22:53:35.991Z","3.2.3":"2023-01-17T20:12:40.960Z","3.2.2":"2022-11-03T22:15:23.849Z","3.2.1":"2022-10-18T22:59:27.661Z","0.0.0":"2022-10-18T22:53:35.991Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/electron/asar.git"},"versions":{"3.2.3":{"name":"@electron/asar","description":"Creating Electron app packages","version":"3.2.3","main":"./lib/asar.js","types":"./lib/index.d.ts","bin":{"asar":"bin/asar.js"},"engines":{"node":">=10.12.0"},"license":"MIT","homepage":"https://github.com/electron/asar","repository":{"type":"git","url":"git+https://github.com/electron/asar.git"},"bugs":{"url":"https://github.com/electron/asar/issues"},"scripts":{"mocha":"xvfb-maybe electron-mocha --reporter spec && mocha --reporter spec","test":"npm run lint && npm run mocha","lint":"tsd && standard","standard":"standard","tsd":"tsd"},"standard":{"env":{"mocha":true},"globals":["BigInt"]},"tsd":{"directory":"test"},"dependencies":{"chromium-pickle-js":"^0.2.0","commander":"^5.0.0","glob":"^7.1.6","minimatch":"^3.0.4","@types/glob":"^7.1.1"},"optionalDependencies":{"@types/glob":"^7.1.1"},"devDependencies":{"@continuous-auth/semantic-release-npm":"^3.0.0","electron":"^22.0.0","electron-mocha":"^11.0.2","lodash":"^4.17.15","mocha":"^10.1.0","rimraf":"^3.0.2","standard":"^14.3.3","tsd":"^0.25.0","xvfb-maybe":"^0.2.1"},"gitHead":"6a2ac89ac811c37dccba7207cefa7bc982f06d86","_id":"@electron/asar@3.2.3","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"shasum":"f598db50061ae5f90ad651f0255366b4e818000e","size":10114,"noattachment":false,"key":"/@electron/asar/-/@electron/asar-3.2.3.tgz","tarball":"http://name.csiicloud.com:7001/@electron/asar/download/@electron/asar-3.2.3.tgz"},"_npmUser":{"name":"electron-cfa","email":"info+cfa-npm@electronjs.org"},"directories":{},"maintainers":[{"name":"electron-cfa","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/asar_3.2.3_1673986360804_0.3714237471206734"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-17T20:12:40.960Z","publish_time":1673986360960,"_cnpm_publish_time":1673986360960},"3.2.2":{"name":"@electron/asar","description":"Creating Electron app packages","version":"3.2.2","main":"./lib/asar.js","types":"./lib/index.d.ts","bin":{"asar":"bin/asar.js"},"engines":{"node":">=10.12.0"},"license":"MIT","homepage":"https://github.com/electron/asar","repository":{"type":"git","url":"git+https://github.com/electron/asar.git"},"bugs":{"url":"https://github.com/electron/asar/issues"},"scripts":{"mocha":"xvfb-maybe electron-mocha --reporter spec && mocha --reporter spec","test":"npm run lint && npm run mocha","lint":"tsd && standard","standard":"standard","tsd":"tsd"},"standard":{"env":{"mocha":true},"globals":["BigInt"]},"tsd":{"directory":"test"},"dependencies":{"chromium-pickle-js":"^0.2.0","commander":"^5.0.0","glob":"^7.1.6","minimatch":"^3.0.4","@types/glob":"^7.1.1"},"optionalDependencies":{"@types/glob":"^7.1.1"},"devDependencies":{"@continuous-auth/semantic-release-npm":"^2.0.0","@semantic-release/changelog":"^5.0.0","electron":"^5.0.0","electron-mocha":"^8.2.1","lodash":"^4.17.15","mocha":"^7.1.1","rimraf":"^3.0.2","semantic-release":"^17.0.4","standard":"^14.3.3","tsd":"^0.11.0","xvfb-maybe":"^0.2.1"},"gitHead":"a4a60718d042826d957ad4bb0baaf20cfc19c0bc","_id":"@electron/asar@3.2.2","_nodeVersion":"14.19.3","_npmVersion":"6.13.4","dist":{"shasum":"f6ae4eb4343ad00b994c40db3f09f71f968ff9c0","size":11457,"noattachment":false,"key":"/@electron/asar/-/@electron/asar-3.2.2.tgz","tarball":"http://name.csiicloud.com:7001/@electron/asar/download/@electron/asar-3.2.2.tgz"},"_npmUser":{"name":"electron-cfa","email":"info+cfa-npm@electronjs.org"},"directories":{},"maintainers":[{"name":"electron-cfa","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/asar_3.2.2_1667513723695_0.9420470596601633"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-11-03T22:22:40.204Z","publish_time":1667513723849,"_cnpm_publish_time":1667513723849},"3.2.1":{"name":"@electron/asar","description":"Creating Electron app packages","version":"3.2.1","main":"./lib/asar.js","types":"./lib/index.d.ts","bin":{"asar":"bin/asar.js"},"engines":{"node":">=10.12.0"},"license":"MIT","homepage":"https://github.com/electron/asar","repository":{"type":"git","url":"git+https://github.com/electron/asar.git"},"bugs":{"url":"https://github.com/electron/asar/issues"},"scripts":{"mocha":"xvfb-maybe electron-mocha --reporter spec && mocha --reporter spec","test":"npm run lint && npm run mocha","lint":"tsd && standard","standard":"standard","tsd":"tsd"},"standard":{"env":{"mocha":true},"globals":["BigInt"]},"tsd":{"directory":"test"},"dependencies":{"chromium-pickle-js":"^0.2.0","commander":"^5.0.0","glob":"^7.1.6","minimatch":"^3.0.4","@types/glob":"^7.1.1"},"optionalDependencies":{"@types/glob":"^7.1.1"},"devDependencies":{"@continuous-auth/semantic-release-npm":"^2.0.0","@semantic-release/changelog":"^5.0.0","electron":"^5.0.0","electron-mocha":"^8.2.1","lodash":"^4.17.15","mocha":"^7.1.1","rimraf":"^3.0.2","semantic-release":"^17.0.4","standard":"^14.3.3","tsd":"^0.11.0","xvfb-maybe":"^0.2.1"},"gitHead":"8384406e55ee8c4aa3179c6d15ec7b909127ac3b","_id":"@electron/asar@3.2.1","_nodeVersion":"14.19.3","_npmVersion":"6.13.4","dist":{"shasum":"c4143896f3dd43b59a80a9c9068d76f77efb62ea","size":11411,"noattachment":false,"key":"/@electron/asar/-/@electron/asar-3.2.1.tgz","tarball":"http://name.csiicloud.com:7001/@electron/asar/download/@electron/asar-3.2.1.tgz"},"_npmUser":{"name":"electron-cfa","email":"info+cfa-npm@electronjs.org"},"directories":{},"maintainers":[{"name":"electron-cfa","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/asar_3.2.1_1666133967459_0.4063699794815967"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-10-18T23:08:28.518Z","publish_time":1666133967661,"_cnpm_publish_time":1666133967661},"0.0.0":{"name":"@electron/asar","version":"0.0.0","_id":"@electron/asar@0.0.0","_nodeVersion":"14.19.1","_npmVersion":"6.14.16","dist":{"shasum":"5ec3c68035222158c588bb3edefff46d3ee82e9b","size":152,"noattachment":false,"key":"/@electron/asar/-/@electron/asar-0.0.0.tgz","tarball":"http://name.csiicloud.com:7001/@electron/asar/download/@electron/asar-0.0.0.tgz"},"_npmUser":{"name":"electronhq","email":"electron@github.com"},"directories":{},"maintainers":[{"name":"electron-cfa","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/asar_0.0.0_1666133615858_0.14447336089593232"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-10-18T23:08:28.009Z","publish_time":1666133615991,"_cnpm_publish_time":1666133615991}},"readme":"# @electron/asar - Electron Archive\n\n[![CircleCI build status](https://circleci.com/gh/electron/asar/tree/main.svg?style=shield)](https://circleci.com/gh/electron/asar/tree/main)\n[![npm version](http://img.shields.io/npm/v/@electron/asar.svg)](https://npmjs.org/package/@electron/asar)\n\nAsar is a simple extensive archive format, it works like `tar` that concatenates\nall files together without compression, while having random access support.\n\n## Features\n\n* Support random access\n* Use JSON to store files' information\n* Very easy to write a parser\n\n## Command line utility\n\n### Install\n\nThis module requires Node 10 or later.\n\n```bash\n$ npm install --engine-strict @electron/asar\n```\n\n### Usage\n\n```bash\n$ asar --help\n\n  Usage: asar [options] [command]\n\n  Commands:\n\n    pack|p <dir> <output>\n       create asar archive\n\n    list|l <archive>\n       list files of asar archive\n\n    extract-file|ef <archive> <filename>\n       extract one file from archive\n\n    extract|e <archive> <dest>\n       extract archive\n\n\n  Options:\n\n    -h, --help     output usage information\n    -V, --version  output the version number\n\n```\n\n#### Excluding multiple resources from being packed\n\nGiven:\n```\n    app\n(a) ├── x1\n(b) ├── x2\n(c) ├── y3\n(d) │   ├── x1\n(e) │   └── z1\n(f) │       └── x2\n(g) └── z4\n(h)     └── w1\n```\n\nExclude: a, b\n```bash\n$ asar pack app app.asar --unpack-dir \"{x1,x2}\"\n```\n\nExclude: a, b, d, f\n```bash\n$ asar pack app app.asar --unpack-dir \"**/{x1,x2}\"\n```\n\nExclude: a, b, d, f, h\n```bash\n$ asar pack app app.asar --unpack-dir \"{**/x1,**/x2,z4/w1}\"\n```\n\n## Using programatically\n\n### Example\n\n```javascript\nconst asar = require('@electron/asar');\n\nconst src = 'some/path/';\nconst dest = 'name.asar';\n\nawait asar.createPackage(src, dest);\nconsole.log('done.');\n```\n\nPlease note that there is currently **no** error handling provided!\n\n### Transform\nYou can pass in a `transform` option, that is a function, which either returns\nnothing, or a `stream.Transform`. The latter will be used on files that will be\nin the `.asar` file to transform them (e.g. compress).\n\n```javascript\nconst asar = require('@electron/asar');\n\nconst src = 'some/path/';\nconst dest = 'name.asar';\n\nfunction transform (filename) {\n  return new CustomTransformStream()\n}\n\nawait asar.createPackageWithOptions(src, dest, { transform: transform });\nconsole.log('done.');\n```\n\n## Using with grunt\n\nThere is also an unofficial grunt plugin to generate asar archives at [bwin/grunt-asar][grunt-asar].\n\n## Format\n\nAsar uses [Pickle][pickle] to safely serialize binary value to file, there is\nalso a [node.js binding][node-pickle] of `Pickle` class.\n\nThe format of asar is very flat:\n\n```\n| UInt32: header_size | String: header | Bytes: file1 | ... | Bytes: file42 |\n```\n\nThe `header_size` and `header` are serialized with [Pickle][pickle] class, and\n`header_size`'s [Pickle][pickle] object is 8 bytes.\n\nThe `header` is a JSON string, and the `header_size` is the size of `header`'s\n`Pickle` object.\n\nStructure of `header` is something like this:\n\n```json\n{\n   \"files\": {\n      \"tmp\": {\n         \"files\": {}\n      },\n      \"usr\" : {\n         \"files\": {\n           \"bin\": {\n             \"files\": {\n               \"ls\": {\n                 \"offset\": \"0\",\n                 \"size\": 100,\n                 \"executable\": true,\n                 \"integrity\": {\n                   \"algorithm\": \"SHA256\",\n                   \"hash\": \"...\",\n                   \"blockSize\": 1024,\n                   \"blocks\": [\"...\", \"...\"]\n                 }\n               },\n               \"cd\": {\n                 \"offset\": \"100\",\n                 \"size\": 100,\n                 \"executable\": true,\n                 \"integrity\": {\n                   \"algorithm\": \"SHA256\",\n                   \"hash\": \"...\",\n                   \"blockSize\": 1024,\n                   \"blocks\": [\"...\", \"...\"]\n                 }\n               }\n             }\n           }\n         }\n      },\n      \"etc\": {\n         \"files\": {\n           \"hosts\": {\n             \"offset\": \"200\",\n             \"size\": 32,\n             \"integrity\": {\n                \"algorithm\": \"SHA256\",\n                \"hash\": \"...\",\n                \"blockSize\": 1024,\n                \"blocks\": [\"...\", \"...\"]\n              }\n           }\n         }\n      }\n   }\n}\n```\n\n`offset` and `size` records the information to read the file from archive, the\n`offset` starts from 0 so you have to manually add the size of `header_size` and\n`header` to the `offset` to get the real offset of the file.\n\n`offset` is a UINT64 number represented in string, because there is no way to\nprecisely represent UINT64 in JavaScript `Number`. `size` is a JavaScript\n`Number` that is no larger than `Number.MAX_SAFE_INTEGER`, which has a value of\n`9007199254740991` and is about 8PB in size. We didn't store `size` in UINT64\nbecause file size in Node.js is represented as `Number` and it is not safe to\nconvert `Number` to UINT64.\n\n`integrity` is an object consisting of a few keys:\n* A hashing `algorithm`, currently only `SHA256` is supported.\n* A hex encoded `hash` value representing the hash of the entire file.\n* An array of hex encoded hashes for the `blocks` of the file.  i.e. for a blockSize of 4KB this array contains the hash of every block if you split the file into N 4KB blocks.\n* A integer value `blockSize` representing the size in bytes of each block in the `blocks` hashes above\n\n[pickle]: https://chromium.googlesource.com/chromium/src/+/main/base/pickle.h\n[node-pickle]: https://www.npmjs.org/package/chromium-pickle-js\n[grunt-asar]: https://github.com/bwin/grunt-asar\n","_attachments":{},"homepage":"https://github.com/electron/asar","bugs":{"url":"https://github.com/electron/asar/issues"},"license":"MIT"}