{"_id":"8pack","_rev":"7-9965189577cb8d30417b5fa22a95f06a","name":"8pack","dist-tags":{"latest":"0.2.0"},"versions":{"0.0.1":{"name":"8pack","version":"0.0.1","description":"8pack\r =====","main":"8pack.js","start":"8pack.js","man":["./src/8pack.man"],"scripts":{"test":"jasmine-node spec"},"author":"","license":"ISC","dependencies":{"chalk":"^2.0.1","minimist":"^1.2.0"},"devDependencies":{"jasmine-node":"^1.14.5"},"gitHead":"2d896f0a0c1aeac20edf75db0ac92eba5405cbf3","_id":"8pack@0.0.1","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"kepi","email":"kepi@binks.rocks"},"dist":{"integrity":"sha512-nSzlcEExZztqhOhRfueB2+8McdPm0Lng4tapcxGJ9jzH4zX9g5vTPybpZBaWEGafgUe63/y65fZx0mTKwkmN/A==","shasum":"dce149ae3c3407cd244896efbc56a53c9fa613b1","tarball":"https://registry.npmjs.org/8pack/-/8pack-0.0.1.tgz","fileCount":13,"unpackedSize":148372,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBwTu1MBkRvpUJdjNzliYz6z9rbIGkGjsLK6h+invP2zAiEA2rr63uG0oD2H77UxnPgK/GaaR+44H5rgvPp5NPovM8o="}]},"maintainers":[{"name":"kepi","email":"kepi@binks.rocks"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/8pack_0.0.1_1518948538645_0.9836703372246827"},"_hasShrinkwrap":false},"0.0.2":{"name":"8pack","version":"0.0.2","description":"8pack\r ====================","main":"8pack.js","start":"8pack.js","man":["./src/8pack.man"],"scripts":{"test":"jasmine-node spec"},"bin":{"8pack":"./bin/8pack"},"author":{"name":"KepiKoi"},"license":"ISC","dependencies":{"chalk":"^2.0.1","minimist":"^1.2.0"},"devDependencies":{"jasmine-node":"^1.14.5"},"gitHead":"8dbaac9b31a6097d685b3eb9109006387ed6a3d1","_id":"8pack@0.0.2","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"kepi","email":"kepi@binks.rocks"},"dist":{"integrity":"sha512-ssbE2OGLf1s76p1uCPaA0k5YKQydpc6xbgVbs6OBo785zHNKDzKDRrt70ZHa3CeaRBB1+8j15cqoIdPIo9xi1Q==","shasum":"a50546eee0435ad582f9849b9e0e561280bc8e70","tarball":"https://registry.npmjs.org/8pack/-/8pack-0.0.2.tgz","fileCount":14,"unpackedSize":148685,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIENUBzhmWG1xF2COiMVpgtycNRv9ITpZhhND82m2hlyMAiEApqxfDLarb+cKOwKss7L+9jSXwpihvq0yUOW9PpN/Hjs="}]},"maintainers":[{"name":"kepi","email":"kepi@binks.rocks"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/8pack_0.0.2_1518957048236_0.26885452954933986"},"_hasShrinkwrap":false},"0.0.3":{"name":"8pack","version":"0.0.3","description":"8pack\r ====================","main":"8pack.js","start":"8pack.js","man":["./src/8pack.man"],"scripts":{"test":"jasmine-node spec"},"bin":{"8pack":"./bin/8pack"},"author":{"name":"KepiKoi"},"license":"ISC","dependencies":{"chalk":"^2.0.1","minimist":"^1.2.0"},"devDependencies":{"jasmine-node":"^1.14.5"},"gitHead":"d7c1cdae6a11caff71de4d80bd1b98c66ff55943","_id":"8pack@0.0.3","_npmVersion":"5.6.0","_nodeVersion":"9.3.0","_npmUser":{"name":"kepi","email":"kepi@binks.rocks"},"dist":{"integrity":"sha512-vn9oKEE8FZm76zQ2OOkj7cFdUNCFHaYNZw1BEa0EI6QsngqJaB8HmXfl84f7co6uNjB1pq/5JuoxuDleuh+3EA==","shasum":"1b550d374ef3d03253e78a1d9626bfb957a2e088","tarball":"https://registry.npmjs.org/8pack/-/8pack-0.0.3.tgz","fileCount":14,"unpackedSize":164637,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHZ4ZVt0fprCv2w6Tdunr4b/oHs/DKU8trKf2r5tAWUkAiEA8sJUIrNw5AMoUr1KXlmphU+vhks3A3AyyXrsYBBWHeY="}]},"maintainers":[{"name":"kepi","email":"kepi@binks.rocks"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/8pack_0.0.3_1518990105005_0.2929177454309091"},"_hasShrinkwrap":false},"0.1.0":{"name":"8pack","version":"0.1.0","description":"8pack\r ====================","main":"8pack.js","start":"8pack.js","scripts":{"test":"mocha"},"bin":{"8pack":"./bin/8pack"},"author":{"name":"kepikoi","email":"kepi@binks.rocks"},"license":"ISC","dependencies":{"chalk":"^2.0.1","md5":"^2.2.1","minimist":"^1.2.0"},"devDependencies":{"chai":"^4.1.2","eslint":"^4.18.1","mocha":"^5.0.1","random-string":"^0.2.0"},"gitHead":"c7327e93ec75c1d7983033031c45638d2819b12b","_id":"8pack@0.1.0","_npmVersion":"5.8.0","_nodeVersion":"9.3.0","_npmUser":{"name":"kepi","email":"kepi@binks.rocks"},"dist":{"integrity":"sha512-OEdJh21l7pbf9b4F/IHSMykeDxWtBq4VEptUf+/rgoHuXgBVPHg/IKWX6v+cFmbNlPUBmDcTMB2berFeuYsobg==","shasum":"4237c5b52ca934ee985249c669479c8007672954","tarball":"https://registry.npmjs.org/8pack/-/8pack-0.1.0.tgz","fileCount":23,"unpackedSize":65425,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHJuqUJ8rIwJyPPY4667jVS/zRvq5wnt6VkmUERTmQ1wAiEA6kKO+wEtPVFQQ83njwb3QBolF9xqB2i+H7QyYYUACXc="}]},"maintainers":[{"name":"kepi","email":"kepi@binks.rocks"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/8pack_0.1.0_1523283221503_0.9026718289988411"},"_hasShrinkwrap":false},"0.1.1":{"name":"8pack","version":"0.1.1","description":"8pack\r ====================","main":"8pack.js","start":"8pack.js","scripts":{"test":"mocha"},"bin":{"8pack":"./bin/8pack"},"author":{"name":"kepikoi","email":"kepi@binks.rocks"},"license":"ISC","dependencies":{"chalk":"^2.0.1","md5":"^2.2.1","minimist":"^1.2.0"},"devDependencies":{"chai":"^4.1.2","eslint":"^4.18.1","mocha":"^5.0.1","random-string":"^0.2.0"},"gitHead":"7579cac64337a60a76de8d2aec48c19fee8fc409","_id":"8pack@0.1.1","_npmVersion":"5.8.0","_nodeVersion":"9.11.1","_npmUser":{"name":"kepi","email":"kepi@binks.rocks"},"dist":{"integrity":"sha512-Gs0828feCD+q5Dz3Tc+J3MELduz07FlQ0fls6xaIzRIgzcBREWZ7I3+riC919JdYTs4RoDlVlFHEeFHEpPpXEQ==","shasum":"b8536f37eba9e660c97066a3353eb2270ac45ff2","tarball":"https://registry.npmjs.org/8pack/-/8pack-0.1.1.tgz","fileCount":23,"unpackedSize":65522,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFhgStK/7wf4M+iy9586GpA6VjkWweVfeU0p7j1dFSHpAiEAgaGVEHocSudMs4KgOrnOeQJAk8vODv/X98+TpEZcWTQ="}]},"maintainers":[{"name":"kepi","email":"kepi@binks.rocks"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/8pack_0.1.1_1523285505166_0.4953089194803715"},"_hasShrinkwrap":false},"0.2.0":{"name":"8pack","version":"0.2.0","description":"8pack\r ====================","main":"8pack.js","start":"8pack.js","scripts":{"test":"mocha"},"bin":{"8pack":"./bin/8pack"},"author":{"name":"kepikoi","email":"kepi@binks.rocks"},"license":"ISC","dependencies":{"chalk":"^2.0.1","md5":"^2.2.1","minimist":"^1.2.0"},"devDependencies":{"chai":"^4.1.2","eslint":"^4.18.1","mocha":"^5.0.1","random-string":"^0.2.0"},"gitHead":"c9270b4da8f600556225ee5e831da5c7e3e63523","_id":"8pack@0.2.0","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"kepi","email":"kepi@binks.rocks"},"dist":{"integrity":"sha512-+p04hdmZQ99xNJ9M8mzU+OXRHGxLoQ6HWAPpLREDpBoJonNfPJ4xn+Uxf3NVqQnGWevIw92BuMfONPW174+RcQ==","shasum":"c6c3129f23b43122b69d7d6a656b372c908792fa","tarball":"https://registry.npmjs.org/8pack/-/8pack-0.2.0.tgz","fileCount":23,"unpackedSize":48275,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa/RzUCRA9TVsSAnZWagAA2woP/RdIhkHXbbtBmD0bbXBn\nPip7GTLRVyz0DrRufRAtdb9xs+tmwz+Ocz21zCBw44RDreYf6QXKiCYoL8nC\nx7/feoHiz21viKThXqa5rkl7L9lRpjt/CkzBUvi8ntTiQczAPluESaU/Ts8N\nckrsUm6Tz0MQaChVeaP2ykPtTDmYz7uhzER+vLZf796siBkSUQWdya/X+Qxw\n5Pnl8MId807ROBh3N+Y1DeegBUYOWsHpiYqDF4OHa4JDK0MIeZuAgfmI/aXj\nPe70H2dTjN8OMxwbRuV9yO8C+DLYPt1lfFaVoibNZQCFKUEGVQwbG4mPbosQ\ndkcOZrCgeKQe4BPfzhKuFq73DA/t1Of5ZF6b6xEKNEeq0UQWTZS4AzwWRGeZ\nCtu9cgoDJzxd1eeKmkQEsb6I6WTgvMrYkS0FMdywrakiH2Tsxd9dh6iJ4YYC\nWYBPbNPQyrLkguOzbrtMDCXb9RT4kF2gbvjPQNUd7g/YamYvxM+2WpmPkpgR\nUdxgeS2ApTX3Vsebu8/GGGQdQeBKSll3ZrEAJ8ifk+rBjCoLMiA5N8+RIllE\nX1EG0n2krASpP0xd7ND7vH3T9iZtE3pV+OWvM/rkG82tmzjNPglPPLyH4g4g\n7pHB3otgFuhbnXxeiyh1Q96FcflgiBFNWP+2PnBKRzIRqJiDihjXCyMUDbDN\nJz2j\r\n=QbLa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEyp0QzjTZL13HC1PaW1I1zPyEwzZ5EI3OZSQWNSrn+7AiEA8voPcF/I7CUgeYfpwkdwNOOYETVgAipgM9YHnQ2ERTo="}]},"maintainers":[{"name":"kepi","email":"kepi@binks.rocks"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/8pack_0.2.0_1526537427088_0.6931376159959457"},"_hasShrinkwrap":false}},"time":{"created":"2018-02-18T10:08:58.645Z","0.0.1":"2018-02-18T10:08:58.697Z","modified":"2022-04-04T10:24:57.243Z","0.0.2":"2018-02-18T12:30:48.317Z","0.0.3":"2018-02-18T21:41:45.138Z","0.1.0":"2018-04-09T14:13:42.001Z","0.1.1":"2018-04-09T14:51:45.270Z","0.2.0":"2018-05-17T06:10:27.234Z"},"maintainers":[{"name":"kepi","email":"kepi@binks.rocks"}],"description":"8pack\r ====================","license":"ISC","readme":"8pack\r\n====================\r\n\r\nUtility that injects modular Lua source into a [PICO-8](https://www.lexaloffle.com/pico-8.php) project. \r\n---\r\n\r\n## Installation\r\n````bash\r\nnpm install 8pack -g\r\n````\r\n\r\n## Examples\r\n\r\nCreate *sample.lua.p8* from *sample.lua* using newest PICO-8 template\r\n````bash\r\n8pack tests/sample.lua\r\n````\r\n\r\nInject *sample.lua* source into *foo.p8*. Will overwrite *foo.p8* if already exists.\r\n````bash\r\n8pack tests/sample.lua foo.p8  \r\n````\r\n\r\nWatch */tests/sample.lua* for changes and overwrite to */tests/sample.lua.p8*\r\n````bash\r\n8pack /tests/sample.lua -w  \r\n````\r\n\r\nWrite */tests/sample.lua* source to */tests/foo.p8* using PICO-8 0.1.10c template \r\n````bash\r\n8pack tests/sample.lua /tests/foo.p8 --template 0.1.10c\r\n````\r\n\r\n## Modules\r\nLua modules can be imported via ```require('./libs/lib')``` and will be injected to the top of the p8 file as global variables. \r\nEach module must return a table, variable or a function. Use node.js style path prefixes to access parent directories: ``require('../lib')``\r\n\r\n\r\n*main.lua:*\r\n```lua\r\nlocal liba = require('./liba');\r\n\r\nfunction _init()\r\n    state = {\r\n        hi = \"hello world\",\r\n        i = 0,\r\n        someFunct = function()\r\n            return 1\r\n        end,\r\n        someOtherFunct = function()\r\n            return 0\r\n        end\r\n    }\r\nend\r\n\r\nfunction _update60()\r\n    state.i = state.i + rnd(liba.iterator);\r\nend\r\n\r\nfunction _draw()\r\n    cls();\r\n    print(liba.foo() .. ' ' .. state.i, 0, 116, 7);\r\nend\r\n```\r\n\r\n*./liba.lua module:*\r\n```lua\r\nlocal lib = {\r\n    foo = function()\r\n        return 'hello world'\r\n    end,\r\n}\r\nlib.iterator = 1\r\n\r\nreturn lib;\r\n```\r\n\r\nEach injection is instantiated as a new function in pico8 code thus no code can be shared between modules.\r\nAs a workaround 8pack creates a ``globals`` table as the topmost variable inside the project which can be accessed from every module.\r\n\r\n*./helpers.lua module:*\r\n```lua\r\nlocal helpers = {\r\n    setLevel = function(level)\r\n        globals.level = level\r\n    end,\r\n}\r\n\r\nreturn lib;\r\n```\r\n\r\n*./game.lua module:*\r\n```lua\r\nreturn {\r\n   nextLevel = function() \r\n     globals.level =  globals.level+1\r\n     return globals.level\r\n   end\r\n} \r\n```\r\n\r\n## JetBrains Watcher Arguments\r\nInstall 8pack globally and add 8pack bin as watcher with following arguments for on-the-fly injection \r\n````\r\n$ProjectFileDir$/projectroot.lua $ProjectFileDir$/project.p8\r\n````\r\ne.g. for Lua watcher in PhpStorm 2017.3 on Windows 10 (I'm using the official Lua plugin)\r\n![Screenshot](https://github.com/kepikoi/8pack/raw/master/screenshots/jetbrains.png)\r\n\r\n\r\n## ToDos\r\n* Circular dependancy checks \r\n* Module order checks\r\n* Prevent pedundant imports\r\n* Honor token limits\r\n* Compress code","readmeFilename":"readme.md","author":{"name":"kepikoi","email":"kepi@binks.rocks"}}