{"_id":"@ckoenig1/slippi-js","_rev":"1-06f5111c8162048491a6b95cb4d3375c","name":"@ckoenig1/slippi-js","dist-tags":{"latest":"6.1.1"},"versions":{"6.1.1":{"name":"@ckoenig1/slippi-js","version":"6.1.1","description":"Official Project Slippi Javascript SDK","license":"LGPL-3.0-or-later","repository":{"type":"git","url":"git+https://github.com/project-slippi/slippi-js.git"},"author":{"name":"chris koenig","email":"ckoenig1@terpmai.umd.edu","url":"https://github.com/Ckoenig1"},"engines":{"node":">=10"},"main":"dist/index.js","module":"dist/index.es.js","types":"dist/index.d.ts","scripts":{"test":"jest --verbose","coverage":"yarn run test --coverage","postcoverage":"open-cli coverage/lcov-report/index.html","lint":"eslint \"src/**/*.ts\"","lint:fix":"yarn run lint --fix","clean":"rimraf dist","prebuild":"yarn run clean","build":"rollup -c","watch":"rollup -cw","patch":"npm version patch && npm publish","minor":"npm version minor && npm publish","major":"npm version major && npm publish","prepublishOnly":"yarn run lint && yarn run test && yarn run build"},"jest":{"testRegex":"/test/.*","testEnvironment":"node"},"keywords":["slp-parser-js"],"dependencies":{"@shelacek/ubjson":"^1.0.1","enet":"^0.2.9","iconv-lite":"^0.6.2","lodash":"^4.17.19","moment":"^2.27.0","reconnect-core":"^1.3.0","semver":"^7.3.2"},"devDependencies":{"@rollup/plugin-node-resolve":"^8.1.0","@types/jest":"^24.0.18","@types/lodash":"^4.14.138","@types/node":"^12.7.3","@types/reconnect-core":"^1.3.1","@types/semver":"^6.0.2","@typescript-eslint/eslint-plugin":"^4.9.0","@typescript-eslint/parser":"^4.9.0","eslint":"^7.15.0","eslint-config-prettier":"^7.0.0","eslint-import-resolver-typescript":"^2.4.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.2.0","eslint-plugin-simple-import-sort":"^7.0.0","eslint-plugin-strict-booleans":"^1.0.0","husky":"^4.2.5","jest":"^26.6.3","open-cli":"^5.0.0","prettier":"^2.0.5","pretty-quick":"^2.0.1","rimraf":"^3.0.0","rollup":"^2.2.0","rollup-plugin-auto-external":"^2.0.0","rollup-plugin-terser":"^5.3.0","rollup-plugin-typescript2":"^0.27.1","ts-jest":"^26.5.1","typescript":"^3.8.3"},"husky":{"hooks":{"pre-commit":"pretty-quick --staged","pre-push":"yarn lint --quiet"}},"gitHead":"f53a21a8cfbdd8a5f4cc4c405619d59c7da15add","bugs":{"url":"https://github.com/project-slippi/slippi-js/issues"},"homepage":"https://github.com/project-slippi/slippi-js#readme","_id":"@ckoenig1/slippi-js@6.1.1","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-mTjqZ1kydJcEPVwm/+SE9xcJl1cOBhaffQFyS6J/rCXNP6WG3bNdrjdLabwenUxGa6RPcDkMBsxKEp/39XUj4w==","shasum":"18e4ba4ce887cbbb342e237300793a6a3e2e9e64","tarball":"https://registry.npmjs.org/@ckoenig1/slippi-js/-/slippi-js-6.1.1.tgz","fileCount":35,"unpackedSize":376132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgv9keCRA9TVsSAnZWagAAUWkP/iCIlbT0ITSHWmn++tMG\nM+LVjnaYXZegbwsuRnmctriaZlOeRtWvROcEVhqfqXOvd9pwZPrcv2AsNd7B\nqKeiGvIb6BKpImnsuceJVcYGZdNtLeTWKxP7hpkyT7tj85WJQ2eJ3/adPgCW\nwKi4suX0vEh9YnQJvNHtfZ3su2AoB6+vq5Ufe/4rXqjcLsnx1rYd9FXaowmg\nRf7M6BaD/MzZApNPDIkU6gKDgv62FqNOQCmE//tLkh3vb3zu/Ek44WuSG/Jh\nR8wGZV0p+IYzzfS2ieeosGxUuL6YX9tWJVOg1B2OiJl/5bA/fOzUxSqOdeVH\ny9Dcd7Z95R4R636VPb7ZblT530CXsi9RcqFJi7YETaZOUlHAQx/k5rEMVajg\nd+WbVG0TLlUzAI8EsvHJMabxOlEOeH3kY8djdUt2BOxBTchmC5zCF0NPIpLW\neT8mtaikNeuXRNdgGWXPRmTQngmi4oCG5EA35e7AxAti4wWcB7SlZt6TXvKO\nRud93hJaBvQCkgaVef42WakC3g8XnZF+odgAlFzW1sNzqCDKCjDYrGYnOf5F\n7q5vobBir+gNKbWL+27eRrmTbMgVZBqa0IM2HKoEbShdQfvqrw7GeLSevkxp\nl7wyU3/90W0sD3iThNUMVEH9nGNM4WKF6GoqAPlUHoM8OKqualpwbgYvaixE\n3w3C\r\n=H63y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAmtSRQLLszwngb6o980Fp99HdtFl5C8u5GCJpqyn6CYAiEAiuUrnjYhxNha8RvWhi18i/LyNSU4dOL4YvUOKAC11wI="}]},"_npmUser":{"name":"ckoenig1","email":"ckoenig1@terpmail.umd.edu"},"directories":{},"maintainers":[{"name":"ckoenig1","email":"ckoenig1@terpmail.umd.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slippi-js_6.1.1_1623185694289_0.35413165683390835"},"_hasShrinkwrap":false}},"time":{"created":"2021-06-08T20:54:54.247Z","6.1.1":"2021-06-08T20:54:54.436Z","modified":"2022-04-04T23:10:36.737Z"},"maintainers":[{"name":"ckoenig1","email":"ckoenig1@terpmail.umd.edu"}],"description":"Official Project Slippi Javascript SDK","homepage":"https://github.com/project-slippi/slippi-js#readme","keywords":["slp-parser-js"],"repository":{"type":"git","url":"git+https://github.com/project-slippi/slippi-js.git"},"author":{"name":"chris koenig","email":"ckoenig1@terpmai.umd.edu","url":"https://github.com/Ckoenig1"},"bugs":{"url":"https://github.com/project-slippi/slippi-js/issues"},"license":"LGPL-3.0-or-later","readme":"# `slippi-js`\n\n[![npm version](http://img.shields.io/npm/v/@slippi/slippi-js.svg?style=flat)](https://npmjs.org/package/@slippi/slippi-js \"View this project on npm\")\n[![Build Status](https://github.com/project-slippi/slippi-js/workflows/build/badge.svg)](https://github.com/project-slippi/slippi-js/actions?workflow=build)\n[![Coverage Status](https://coveralls.io/repos/github/project-slippi/slippi-js/badge.svg)](https://coveralls.io/github/project-slippi/slippi-js)\n[![License](https://img.shields.io/npm/l/@slippi/slippi-js)](https://github.com/project-slippi/slippi-js/blob/master/LICENSE)\n\nThis is the official Project Slippi Javascript SDK. It provides tools for parsing `.slp` files into structured data and can be used to compute stats. There are already many built-in stats that are computed by the library but the data provided can also be used to compute your own stats.\n\n## Installation\n\n**With NPM**\n\n```bash\nnpm install @slippi/slippi-js\n```\n\n**With Yarn**\n\n```bash\nyarn add @slippi/slippi-js\n```\n\n## Writing a simple script\n\n1. Create a fresh directory on your disk\n2. Inside this new directory, create a file called `script.js`\n3. Fill the `script.js` file with the following contents:\n\n```js\nconst { SlippiGame } = require(\"@slippi/slippi-js\");\n\nconst game = new SlippiGame(\"test.slp\");\n\n// Get game settings – stage, characters, etc\nconst settings = game.getSettings();\nconsole.log(settings);\n\n// Get metadata - start time, platform played on, etc\nconst metadata = game.getMetadata();\nconsole.log(metadata);\n\n// Get computed stats - openings / kill, conversions, etc\nconst stats = game.getStats();\nconsole.log(stats);\n\n// Get frames – animation state, inputs, etc\n// This is used to compute your own stats or get more frame-specific info (advanced)\nconst frames = game.getFrames();\nconsole.log(frames[0].players); // Print frame when timer starts counting down\n```\n\n4. Copy a .slp file into the directory and call it `test.slp`\n5. Browse to the directory from the command line and run the command: `npm install @slippi/slippi-js`. This should create a `node_modules` directory in the folder.\n6. Run the command: `node script.js`. This will run the script above and will print data about the `test.slp` file\n\n## Reading live files\n\nWhen using Slippi to mirror gameplay, it can be useful to extract game data about the live game. There are a few different methods of doing this but `slippi-js` can also be used to read live files. It is written in such a way where as long as the same SlippiGame class is used, it will only read from disk the data it has not yet read.\n\nOne thing to note, when creating the `SlippiGame` object, be sure to enable `processOnTheFly` to get updated stats as the game progresses.\n\n```javascript\nconst game = new SlippiGame(\"path/to/your/slp/file\", { processOnTheFly: true });\n```\n\nAn example script for how to do this is provided as part of this repo here: https://github.com/project-slippi/slippi-js/blob/master/scripts/realtimeFileReads.js\n\nTo use the above script, do the following:\n\n1. Open a terminal prompt in the folder containing the script file and the package.json file\n2. Run `yarn` to fetch the dependencies\n3. Run `node realtimeFileReads.js \"C:\\mirror\\output\\path\"` replacing the path argument with where your connected console outputs replay files to\n\nAt this point, you should see an output as you play games on the connected console.\n\n## Development\n\n### Setup\n\n```bash\ngit clone https://github.com/project-slippi/slippi-js\ncd slippi-js\nyarn install\n```\n\n### Build\n\n```bash\nyarn run build\n```\n\nYou can also run `yarn run watch` to continuously build whenever changes are detected.\n\n### Test\n\n```bash\nyarn run test\n```\n","readmeFilename":"README.md"}