{"_id":"@ansi-art/interactive-input","name":"@ansi-art/interactive-input","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@ansi-art/interactive-input","version":"0.0.1","type":"module","main":"dist/index.mjs","module":"src/index.mjs","commonjs":"dist/index.cjs","exports":{".":{"import":"./src/index.mjs","require":"./dist/index.cjs"},"./package.json":{"import":"./package.json","require":"./package.json"},"./src/index.mjs":{"import":"./src/index.mjs","require":"./dist/index.cjs"},"./dist/index.cjs":{"import":"./src/index.mjs","require":"./dist/index.cjs"}},"homepage":"https://github.com/ansi-art/interactive-input","description":"input monitoring for terminal applications","keywords":[],"author":{"name":"Abbey Hawk Sparrow","email":"khrome","url":"http://abbeyhawksparrow.com"},"contributors":[],"repository":{"type":"git","url":"git+ssh://git@github.com/ansi-art/interactive-input.git"},"bugs":{"url":"https://github.com/ansi-art/interactive-input/issues"},"moka":{"firefox":{"engine":"@open-automaton/playwright-mining-engine","options":{"type":"firefox"}},"chrome":{"engine":"@open-automaton/playwright-mining-engine","options":{"type":"chromium"}},"safari":{"engine":"@open-automaton/playwright-mining-engine","options":{"type":"webkit"}},"stub":"node_modules/@open-automaton/moka/src/stub.mjs","stubs":["express","module","os","fs","path"],"shims":{"chai":"node_modules/chai/chai.js","browser-or-node":"node_modules/browser-or-node/src/index.js"}},"license":"MIT","devDependencies":{"@babel/cli":"^7.22.5","@babel/core":"^7.22.5","@babel/plugin-transform-modules-commonjs":"^7.22.5","@environment-safe/chai":"^0.2.0","@environment-safe/commonjs-builder":"^0.0.3","@environment-safe/jsdoc-builder":"^0.0.2","@open-automaton/moka":"^0.5.2","babel-plugin-search-and-replace":"^1.1.1","babel-plugin-transform-import-meta":"^2.2.0","chai":"^4.3.7","eslint":"^8.43.0","husky":"^8.0.3","mocha":"^10.2.0"},"scripts":{"lint":"eslint src/*.mjs test/*.mjs","test":"npm run import-test; npm run browser-test; npm run require-test","import-test":"mocha test/test.mjs","require-test":"mocha test/test.cjs","build-commonjs":"./node_modules/@environment-safe/commonjs-builder/bin/build.mjs","local-server":"open 'http://localhost:8085/' ; npx http-server -p 8085","headless-browser-test":"npm run headless-chrome-test; npm run headless-firefox-test; npm run headless-safari-test","headless-chrome-test":"moka --server . --browser chrome test/test.mjs","headless-firefox-test":"moka --server . --browser firefox test/test.mjs","headless-safari-test":"moka --server . --browser safari test/test.mjs","browser-test":"moka --server . --local-browser test/test.mjs","container-test":"docker build . -t environment-safe-package.json -f ./containers/test.dockerfile; docker logs --follow \"$(docker run -d environment-safe-package.json)\"","build-docs":"build-jsdoc docs","build-types":"build-jsdoc types","add-generated-files-to-commit":"git add docs/*.md; git add src/*.d.ts; git add dist/*.cjs","prepare":"husky install"},"dependencies":{"browser-or-node":"^2.1.1","extended-emitter":"^1.6.0"},"_id":"@ansi-art/interactive-input@0.0.1","gitHead":"9f4c520b3479522b86d0b19f89737e41a086e156","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-IXhWZC6FzUU2SK00R1fJMaBH9Mvj84x4m5woaVjiQhY5qk72f/Z83YiMUurlMTqr9ddM7AnWDTzgmJq5Q0qz6A==","shasum":"6e8d45b7da5aa0c70109c1b7a8c2943433387705","tarball":"https://registry.npmjs.org/@ansi-art/interactive-input/-/interactive-input-0.0.1.tgz","fileCount":16,"unpackedSize":28360,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFUTCuiuFqbueBVx/VSmmXxuCb2b9RG6yjFrhD72lTuFAiBRBd/FiaIF/jTSa8T7jVc8N+IvscQiWbYhC4m4EqU72Q=="}]},"_npmUser":{"name":"khrome","email":"abbey@khrome.net"},"directories":{},"maintainers":[{"name":"khrome","email":"abbey@khrome.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/interactive-input_0.0.1_1735425233735_0.47961436326847284"},"_hasShrinkwrap":false}},"time":{"created":"2024-12-28T22:33:53.541Z","0.0.1":"2024-12-28T22:33:53.906Z","modified":"2024-12-28T22:33:54.289Z"},"maintainers":[{"name":"khrome","email":"abbey@khrome.net"}],"description":"input monitoring for terminal applications","homepage":"https://github.com/ansi-art/interactive-input","keywords":[],"repository":{"type":"git","url":"git+ssh://git@github.com/ansi-art/interactive-input.git"},"contributors":[],"author":{"name":"Abbey Hawk Sparrow","email":"khrome","url":"http://abbeyhawksparrow.com"},"bugs":{"url":"https://github.com/ansi-art/interactive-input/issues"},"license":"MIT","readme":"interactive-input\n============================\nGet browser-like input on the command line in pure JS using ansi escape codes.\n\nUsage\n-----\n\n```js\nconst tracker = new InteractiveInput({});\nprocess.stdin.setRawMode(true);\nprocess.stdin.on('data', (buffer) => {\n    tracker.consume(buffer.toJSON());\n});\ntracker.start();\nconst gracefulTerminate = ()=>{ tracker.stop(); };\nprocess.on('SIGTERM', gracefulTerminate);\nprocess.on('SIGINT', gracefulTerminate);\ntracker.on('keypress', (event)=>{\n    if(event.key === 'Escape'){\n        gracefulTerminate();\n        process.exit();\n    }\n});\ntracker.on('mouseup', (event)=>{ /* ... */  });\ntracker.on('mousedown', (event)=>{ /* ... */  });\ntracker.on('mousemove', (event)=>{ /* ... */  });\n```\n\nTesting\n-------\n\nRun the es module tests to test the root modules\n```bash\nnpm run import-test\n```\nto run the same test inside the browser:\n\n```bash\nnpm run browser-test\n```\nto run the same test headless in chrome:\n```bash\nnpm run headless-browser-test\n```\n\nto run the same test inside docker:\n```bash\nnpm run container-test\n```\n\nRun the commonjs tests against the `/dist` commonjs source (generated with the `build-commonjs` target).\n```bash\nnpm run require-test\n```\n\nDevelopment\n-----------\nAll work is done in the .mjs files and will be transpiled on commit to commonjs and tested.\n\nIf the above tests pass, then attempt a commit which will generate .d.ts files alongside the `src` files and commonjs classes in `dist`\n\n","readmeFilename":"README.md"}