{"_id":"@aleen42/state","_rev":"1-eb75d61c2d939727fa691aa14708cccd","name":"@aleen42/state","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@aleen42/state","version":"1.0.0","description":"A simple implementation of state machines in JavaScript with Generator.","main":"dist/index.js","scripts":{"build":"babel es6.js --out-file dist/index.js","test":"mocha --reporter spec"},"repository":{"type":"git","url":"git+https://github.com/aleen42/state.git"},"keywords":["state","generator"],"author":{"name":"Aleen","email":"aleen42@vip.qq.com"},"license":"MIT","bugs":{"url":"https://github.com/aleen42/state/issues"},"homepage":"https://github.com/aleen42/state#readme","dependencies":{"@babel/runtime-corejs2":"^7.14.6"},"devDependencies":{"@babel/cli":"^7.14.5","@babel/core":"^7.14.6","@babel/plugin-transform-runtime":"^7.14.5","@babel/preset-env":"^7.14.7","chai":"^4.3.4","mocha":"^9.0.2"},"gitHead":"c8b70c51e9ae741cc30ca4a1305cd6afde23e0fa","_id":"@aleen42/state@1.0.0","_nodeVersion":"13.14.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-abQZRLzWl0YBNBtZs/+lIkArgZ7vIRJqhfbJpov9E6f+03q9smEjF3EPTKDRsBYFAT1qus8HdZYyjJW5wjmJdA==","shasum":"fcd1d2ee322fb36b77f77b15ce5c841ec1774b43","tarball":"https://registry.npmjs.org/@aleen42/state/-/state-1.0.0.tgz","fileCount":7,"unpackedSize":11211,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7qT9CRA9TVsSAnZWagAAqrYP/2fkrH0tOfxVmHIwBSDE\n+r3XLqr82eG+W634k5bNid2qc0xJTFjRlxhKz/0p2fs82NO+kVx9+1gFcXL7\nqLWhOGO/otoJQfhUalVOc4LMN8C22w+iMuEJil2j4OefhZBVE4Q7f08AqnAG\n8UL4Ku3zOIMH1I6W63xLNo/UGX6RUbOiWD1cMZBtGopAKDup4yGEUhBF9+kP\nAuDN/Pca+lzV3Uo7ljKzHBFto9TPBTA32N1fvZZmJNQ27uYkCFjwVFFJSkVN\n8TNtWx4QEnbl5XAfe4pOHvbNiuKWnvrCKjd1zmjPpMXuVZLdyORZs7MLswzN\npVWw+ELOq3JRzYDkqEKGwJ6HcW9ERTchCG6Ck9Z3uZHeprPMHqs05FByai7K\nw3hSkPUAuTzGyZfqMqyss9HQtru0f/Cg+Kwgy1AbyME/Qgd6gqYCXbOBCzKU\nlBAZkP+dKUoEvcrMD8TiRNNVk24b9SbGAJwL8XVNZyRgFrHtlQ+EmwppYy7/\n7MimQyuqoJ+u3pTZZMgHgMstFvU2Ls7iHHTPJStajJeWLsl+KjL80ZkwNCh4\nE5uaCdRSgUqP1zsTX+XCzrr8YxtUEgTsHmtM5CmH5SVcftN99o0QJJPwSPzf\n7G4ZjyrRh8L/ahRIghqWDb+i6qkJ/htVe1Jt+YFsd9zdOeEwQrAkavImH3mo\nN00J\r\n=nwgw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPdxVoKTmGDTnKU0c3Q0smrPdBCw53Y8o1aCYnp+6bKgIgJl+8nB2kWJ3dl7RCaqsh3ZSqmvGfnR2eh9Qlu2/Jx0I="}]},"_npmUser":{"name":"aleen42","email":"aleen42@vip.qq.com"},"directories":{},"maintainers":[{"name":"aleen42","email":"aleen42@vip.qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/state_1.0.0_1626252540999_0.8918493752830956"},"_hasShrinkwrap":false}},"time":{"created":"2021-07-14T08:49:00.951Z","1.0.0":"2021-07-14T08:49:01.125Z","modified":"2022-04-04T12:37:00.337Z"},"maintainers":[{"name":"aleen42","email":"aleen42@vip.qq.com"}],"description":"A simple implementation of state machines in JavaScript with Generator.","homepage":"https://github.com/aleen42/state#readme","keywords":["state","generator"],"repository":{"type":"git","url":"git+https://github.com/aleen42/state.git"},"author":{"name":"Aleen","email":"aleen42@vip.qq.com"},"bugs":{"url":"https://github.com/aleen42/state/issues"},"license":"MIT","readme":"## State\n\nA simple implementation of state machines in JavaScript with Generator, which temporarily support under ES6 and above.\n\n### Usage\n\nFor example, there is a state machine with end state:\n\n```\n         E      ;      L\nL: -> 0 ---> 1 ---> 2 ---> 3\n      |                    ^\n      |        ε           |\n      ----------------------\n```\n\nWe can describe it like the following snippet:\n\n```js\nconst State = require('@aleen42/state');\nconst state = new State({\n    'E': [0, 1],\n    ';': [1, 2],\n    'L': [2, 3],\n    'ε': [0, 3],\n}, /* startState */0, /* endState */3);\n\nstate.next(); // => {value: 0, done: false}\nstate.next('E'); // => {value: 1, done: false}\nstate.next(';'); // => {value: 2, done: false}\nstate.next('L'); // => {value: 3, done: true}\n\nstate.reset().next(''); // => {value: 0, done: false}\nstate.next('ε'); // => {value: 0, done: false}\n```\n\n### Release History\n\n* ==================== **1.0.0 Initial release** ====================\n\n### :fuelpump: How to contribute\n\nHave an idea? Found a bug? See [how to contribute](https://wiki.aleen42.com/contribution.html).\n\n### :scroll: License\n\n[MIT](https://wiki.aleen42.com/MIT.html) © aleen42\n","readmeFilename":"README.md"}