{"_id":"@davnpsh/automata","_rev":"10-41c243125eca3c0ba1ac3cad24093fc5","name":"@davnpsh/automata","dist-tags":{"latest":"1.2.4"},"versions":{"1.0.0":{"name":"@davnpsh/automata","version":"1.0.0","keywords":["dfa","udfa","nfa","mdfa","automata","automaton","library"],"author":{"name":"davnpsh"},"license":"GPL-3.0","_id":"@davnpsh/automata@1.0.0","maintainers":[{"name":"davnpsh","email":"remake7972@davnpsh.dev"}],"dist":{"shasum":"2ebe13110a3c5b0c9d1218ccbbb206db3845c4eb","tarball":"https://registry.npmjs.org/@davnpsh/automata/-/automata-1.0.0.tgz","fileCount":11,"integrity":"sha512-XJjRB79putIPRdWm65mr9SXXUCjuitGh9bIz9jz1z2xEXjfwFPsDtqVtVlftxciaoZiTQyi87J8/24DjESwSTA==","signatures":[{"sig":"MEYCIQCieKvfX/hw5x9K0/6E79zos0J0nAHGwCR8CUxN0vWtoAIhANX+WxkyWnGjKrqwgKSJegk+MZ9SAKljVE6QG4KQOQli","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":67804},"main":"dist/index.js","gitHead":"ca0a9ef829378e727a5e80011ac4828ea6f6fdf6","scripts":{"test":"ts-node src/index.ts","build":"tsc"},"_npmUser":{"name":"davnpsh","email":"remake7972@davnpsh.dev"},"_npmVersion":"10.8.3","description":"Automaton generator from regular expressions","directories":{},"_nodeVersion":"22.8.0","_hasShrinkwrap":false,"devDependencies":{"ts-node":"^10.9.2","typescript":"^5.6.2"},"_npmOperationalInternal":{"tmp":"tmp/automata_1.0.0_1726280912283_0.33594586156741935","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@davnpsh/automata","version":"1.0.1","keywords":["dfa","udfa","nfa","mdfa","automata","automaton","library"],"author":{"name":"davnpsh"},"license":"GPL-3.0","_id":"@davnpsh/automata@1.0.1","maintainers":[{"name":"davnpsh","email":"remake7972@davnpsh.dev"}],"dist":{"shasum":"8a0f4da0fe366acf885865d3c0dba25f1f450ce9","tarball":"https://registry.npmjs.org/@davnpsh/automata/-/automata-1.0.1.tgz","fileCount":11,"integrity":"sha512-hS5BIV6Pt6BgQsnCH6a9EJYyuipWih/chRRPGbeRCHhyXSdilf72at084jMf5JGG0FLKvooPBvzTebBAnuo1kw==","signatures":[{"sig":"MEQCIDsiGhgTX+Eec2N12Ckjg5T/9Gu/59L6WHgzuZ5PXPBoAiAP2MONaJwlIWxwIjODRZgSlLWBVBQlFhXqLxCzIoPu7A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68184},"main":"dist/index.js","gitHead":"9e4e1a022f791aade28d4bec9e27bd57505904d0","scripts":{"test":"ts-node test.ts","build":"tsc"},"_npmUser":{"name":"davnpsh","email":"remake7972@davnpsh.dev"},"_npmVersion":"10.8.3","description":"Automaton generator from regular expressions","directories":{},"_nodeVersion":"22.8.0","_hasShrinkwrap":false,"devDependencies":{"ts-node":"^10.9.2","typescript":"^5.6.2"},"_npmOperationalInternal":{"tmp":"tmp/automata_1.0.1_1726289788313_0.16032832888015203","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@davnpsh/automata","version":"1.0.2","keywords":["dfa","udfa","nfa","mdfa","automata","automaton","library"],"author":{"name":"davnpsh"},"license":"GPL-3.0","_id":"@davnpsh/automata@1.0.2","maintainers":[{"name":"davnpsh","email":"remake7972@davnpsh.dev"}],"dist":{"shasum":"111985f539c3e5b11ada9268d6d70ff36db34285","tarball":"https://registry.npmjs.org/@davnpsh/automata/-/automata-1.0.2.tgz","fileCount":12,"integrity":"sha512-+sG1Wzt5lgO+O/0hI0ElXmhYWigDmdketZxTQcTioUvP//u9IxTB9M77QGEu7ZNlhxFcFRjfKyuybP7L9rporQ==","signatures":[{"sig":"MEYCIQCNr06ePe8S5xdJ4W0segI0MroHC93n27qki1OTdD1eLwIhANvdmplUlyXUEECGwwJvtRgaxQ3JJdtwYTghcVDX5l2N","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74710},"main":"dist/index.js","gitHead":"16122ed9f3235ba16fe51f8e8c2c75bf5b4c6566","scripts":{"test":"ts-node test.ts","build":"tsc"},"_npmUser":{"name":"davnpsh","email":"remake7972@davnpsh.dev"},"_npmVersion":"10.8.3","description":"Automaton generator from regular expressions","directories":{},"_nodeVersion":"22.8.0","_hasShrinkwrap":false,"devDependencies":{"ts-node":"^10.9.2","typescript":"^5.6.2"},"_npmOperationalInternal":{"tmp":"tmp/automata_1.0.2_1726362560419_0.8555636719606952","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@davnpsh/automata","version":"1.0.3","keywords":["dfa","udfa","nfa","mdfa","automata","automaton","library"],"author":{"name":"davnpsh"},"license":"GPL-3.0","_id":"@davnpsh/automata@1.0.3","maintainers":[{"name":"davnpsh","email":"remake7972@davnpsh.dev"}],"dist":{"shasum":"c8e16bab79a74c724ecaf7f041d1de1e0240b939","tarball":"https://registry.npmjs.org/@davnpsh/automata/-/automata-1.0.3.tgz","fileCount":12,"integrity":"sha512-DrOKQbmmztIHdYsbjFN6O5XkfVSJa6gIaeber0TGaS9PU3FXKikzdbixwShRY/SBbgPMreOKqTdRakg7bbjSJg==","signatures":[{"sig":"MEUCIH/MxBDLoYMOh2kePk0FB/gAQIFHkEoInWNGzeQ2hJd7AiEAlk+yiEP47XZxieOCdiGgzaWPixkLZCEm/CiXUDFcfaM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":74710},"main":"dist/index.js","gitHead":"84fe69675e6b53fca3e310e03d54ea047942c59a","scripts":{"test":"ts-node test.ts","build":"tsc"},"_npmUser":{"name":"davnpsh","email":"remake7972@davnpsh.dev"},"_npmVersion":"10.8.3","description":"Automaton generator from regular expressions","directories":{},"_nodeVersion":"22.8.0","_hasShrinkwrap":false,"devDependencies":{"ts-node":"^10.9.2","typescript":"^5.6.2"},"_npmOperationalInternal":{"tmp":"tmp/automata_1.0.3_1726676993031_0.6850011289604065","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"@davnpsh/automata","version":"1.0.4","keywords":["dfa","udfa","nfa","mdfa","automata","automaton","library"],"author":{"name":"davnpsh"},"license":"GPL-3.0","_id":"@davnpsh/automata@1.0.4","maintainers":[{"name":"davnpsh","email":"remake7972@davnpsh.dev"}],"dist":{"shasum":"7e443ae19eb3068fba6b804725a387dad5e0a32f","tarball":"https://registry.npmjs.org/@davnpsh/automata/-/automata-1.0.4.tgz","fileCount":13,"integrity":"sha512-+ovgG8Nj4mZQ1NsD3q4AIOR2QuTA/ACvzjmbu+vxNJPpoRnvDlKDaHbdS4qLiu7bBLUpKrhozKySvb43Qb4CnQ==","signatures":[{"sig":"MEQCIA5NfQ/X8ITITTHxiJqOL7YT6bVqcpMDXpC/n4JoKmL0AiAbqmoqlrgSNW++eUc7Ki7Vtr4O+/TBUMQr3Qo7gWpLpg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75599},"main":"dist/index.js","gitHead":"b97577b6dcc9bea66a0e019d85dc4baee918962a","scripts":{"test":"ts-node test.ts","build":"tsc","publish":"npm run build && npm publish"},"_npmUser":{"name":"davnpsh","email":"remake7972@davnpsh.dev"},"_npmVersion":"10.8.3","description":"Automaton generator from regular expressions","directories":{},"_nodeVersion":"22.8.0","_hasShrinkwrap":false,"devDependencies":{"ts-node":"^10.9.2","typescript":"^5.6.2"},"_npmOperationalInternal":{"tmp":"tmp/automata_1.0.4_1726678683113_0.7464761038843961","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@davnpsh/automata","version":"1.1.0","keywords":["dfa","udfa","nfa","mdfa","automata","automaton","library"],"author":{"name":"davnpsh"},"license":"GPL-3.0","_id":"@davnpsh/automata@1.1.0","maintainers":[{"name":"davnpsh","email":"remake7972@davnpsh.dev"}],"dist":{"shasum":"3fec8199ac2e031eb89d013fe0ab57ff191b1fe2","tarball":"https://registry.npmjs.org/@davnpsh/automata/-/automata-1.1.0.tgz","fileCount":13,"integrity":"sha512-8I4YoLKlbv1GXjnh70b1GhUb51Kbn32fRwpJdexc1OozdMLqYnPsnHUcO/Yu+Q6O7imDQBV5jgfoaCutOPMNQA==","signatures":[{"sig":"MEUCIQCrYm6UpS2KdYIzaE3v+mIF0DV1pq0mHc+GbGCn9N0rFgIgBUGKlRm/RwhoKNvH8ZE87erpIRxLjM8wxA4TA6e++2o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75555},"main":"dist/index.js","gitHead":"f49dbbe4f12e964514ff441b8881f19c91d541c2","scripts":{"test":"ts-node test.ts","build":"tsc","publish":"tsc && npm publish"},"_npmUser":{"name":"davnpsh","email":"remake7972@davnpsh.dev"},"_npmVersion":"10.8.3","description":"Automaton generator from regular expressions","directories":{},"_nodeVersion":"22.8.0","_hasShrinkwrap":false,"devDependencies":{"ts-node":"^10.9.2","typescript":"^5.6.2"},"_npmOperationalInternal":{"tmp":"tmp/automata_1.1.0_1726717749343_0.2537714687209194","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"@davnpsh/automata","version":"1.2.0","keywords":["dfa","udfa","nfa","mdfa","automata","automaton","library"],"author":{"name":"davnpsh"},"license":"GPL-3.0","_id":"@davnpsh/automata@1.2.0","maintainers":[{"name":"davnpsh","email":"remake7972@davnpsh.dev"}],"dist":{"shasum":"2790ab35e3cbee7caf4a125b34080cedc6ff0697","tarball":"https://registry.npmjs.org/@davnpsh/automata/-/automata-1.2.0.tgz","fileCount":13,"integrity":"sha512-6X+OwFqgXdIJfzCWuU0rJd96fW0TPVGqPeq7fQvbpDO6Qaa/vN6KDK8Qhp3Ie/zmVH7ZfHVem14kvE7fUfwbtg==","signatures":[{"sig":"MEUCIERgnG0vmRi/WzQiHSn2qsmk0Zh4PdXODvuPYrpXGU1YAiEAhtahmjFqUApj0CzBMVIS9weANepG8mozkEmTThoh+GA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75968},"main":"dist/index.js","gitHead":"4fdc3fd9d7e163b04d191cbae784b52d235d2bea","scripts":{"test":"ts-node test.ts","build":"tsc"},"_npmUser":{"name":"davnpsh","email":"remake7972@davnpsh.dev"},"_npmVersion":"10.8.3","description":"Automaton generator from regular expressions","directories":{},"_nodeVersion":"22.9.0","_hasShrinkwrap":false,"devDependencies":{"ts-node":"^10.9.2","typescript":"^5.6.2"},"_npmOperationalInternal":{"tmp":"tmp/automata_1.2.0_1727055152426_0.5028434049130774","host":"s3://npm-registry-packages"}},"1.2.1":{"name":"@davnpsh/automata","version":"1.2.1","keywords":["dfa","udfa","nfa","mdfa","automata","automaton","library"],"author":{"name":"davnpsh"},"license":"GPL-3.0","_id":"@davnpsh/automata@1.2.1","maintainers":[{"name":"davnpsh","email":"remake7972@davnpsh.dev"}],"dist":{"shasum":"e34cbee1a4dbc715892dc54c41f70afe3da24094","tarball":"https://registry.npmjs.org/@davnpsh/automata/-/automata-1.2.1.tgz","fileCount":13,"integrity":"sha512-+4E+D09cttCWyPncGLHaIG+2hFuVA1o0uaR2cBMv0XvKEiswzFHSWiOcBGqGHWUKv8DZYSs7cqWh18vSoj0+kA==","signatures":[{"sig":"MEQCICdsItaZvRnSxIkuxk3N0vtqfuq13HuGvN0sRISvRd78AiBIVCCrCifSeOHD963mM9YicHLrB+Jv9SKbD1z+pmXLCg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":76052},"main":"dist/index.js","gitHead":"7466d777d86ec0341b18ae9e7ff935cf3971ded5","scripts":{"test":"ts-node test.ts","build":"tsc"},"_npmUser":{"name":"davnpsh","email":"remake7972@davnpsh.dev"},"_npmVersion":"10.8.3","description":"Automaton generator from regular expressions","directories":{},"_nodeVersion":"22.9.0","_hasShrinkwrap":false,"devDependencies":{"ts-node":"^10.9.2","typescript":"^5.6.2"},"_npmOperationalInternal":{"tmp":"tmp/automata_1.2.1_1727056389290_0.6514827841642932","host":"s3://npm-registry-packages"}},"1.2.2":{"name":"@davnpsh/automata","version":"1.2.2","keywords":["dfa","udfa","nfa","mdfa","automata","automaton","library"],"author":{"name":"davnpsh"},"license":"GPL-3.0","_id":"@davnpsh/automata@1.2.2","maintainers":[{"name":"davnpsh","email":"remake7972@davnpsh.dev"}],"dist":{"shasum":"495521dc9994bc3543bf2e0c130b35e3062cde83","tarball":"https://registry.npmjs.org/@davnpsh/automata/-/automata-1.2.2.tgz","fileCount":13,"integrity":"sha512-/FJ935IFaON1aE3LBRRBM1fqdnHcAdGhGnfJgQ9T8ZRxczQN3UHO1QJ6y9mXU04znzzdLY/R6fz2fmyVOGBnbQ==","signatures":[{"sig":"MEUCIGOEX+4WbtaqKND4qpteTwdMlsQpmwrL9Vrf21cV2pOtAiEAk0eZJGbv9515oBZ9h6dukYihw1mjqaXEmOarHswEuv8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":76092},"main":"dist/index.js","gitHead":"84b5eb3b7e6b745e8e6951826a7ccab82cc2452f","scripts":{"test":"ts-node test.ts","build":"tsc"},"_npmUser":{"name":"davnpsh","email":"remake7972@davnpsh.dev"},"_npmVersion":"10.8.3","description":"Automaton generator from regular expressions","directories":{},"_nodeVersion":"22.9.0","_hasShrinkwrap":false,"devDependencies":{"ts-node":"^10.9.2","typescript":"^5.6.2"},"_npmOperationalInternal":{"tmp":"tmp/automata_1.2.2_1727636764543_0.4113633013380533","host":"s3://npm-registry-packages"}},"1.2.3":{"name":"@davnpsh/automata","version":"1.2.3","keywords":["dfa","udfa","nfa","mdfa","automata","automaton","library"],"author":{"name":"davnpsh"},"license":"GPL-3.0","_id":"@davnpsh/automata@1.2.3","maintainers":[{"name":"davnpsh","email":"remake7972@davnpsh.dev"}],"dist":{"shasum":"2edaae3512e0bbf56870dd6abe2ec7c1c14f84ce","tarball":"https://registry.npmjs.org/@davnpsh/automata/-/automata-1.2.3.tgz","fileCount":13,"integrity":"sha512-mpWvrcGBFbfcXKEaybJ4pFay95Zam4WRy2j7QDGyDxxrJWaZMxUhsxzsETA1G4Pwt+bDYj+IMn9uEYqlMbG2CQ==","signatures":[{"sig":"MEUCIDhEyfC0ya/2fsmXAQ2K/n4qJB9Wn/bAti+cYSDcEo++AiEAymWO8ywJUWAPsyzdBptS4ZAo0ZuR0SfV1tHVJ8moVOU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":76195},"main":"dist/index.js","gitHead":"9635b02d598d07b41ca6289801773cf81fef9e3a","scripts":{"test":"ts-node test.ts","build":"tsc"},"_npmUser":{"name":"davnpsh","email":"remake7972@davnpsh.dev"},"_npmVersion":"10.8.3","description":"Automaton generator from regular expressions","directories":{},"_nodeVersion":"22.9.0","_hasShrinkwrap":false,"devDependencies":{"ts-node":"^10.9.2","typescript":"^5.6.2"},"_npmOperationalInternal":{"tmp":"tmp/automata_1.2.3_1727642257960_0.6068643584538631","host":"s3://npm-registry-packages"}},"1.2.4":{"name":"@davnpsh/automata","version":"1.2.4","description":"Automaton generator from regular expressions","main":"dist/index.js","scripts":{"build":"tsc","test":"ts-node test.ts"},"keywords":["dfa","udfa","nfa","mdfa","automata","automaton","library"],"author":{"name":"davnpsh"},"license":"GPL-3.0","devDependencies":{"ts-node":"^10.9.2","typescript":"^5.6.2"},"_id":"@davnpsh/automata@1.2.4","gitHead":"f7d499287aa2a2baab34c358b727eb8295f014ce","_nodeVersion":"22.9.0","_npmVersion":"10.8.3","dist":{"integrity":"sha512-k/E7lbLGcn7+GwhRGRFLhBziU/aMRIfBCKmIrUqfOhDhDe/3uViOOwKCpzDF3NPkJnxstZTXpkbBJ+HJ4/Oq7Q==","shasum":"dc47b13471cf74bfc9f9cf763162600839ad9391","tarball":"https://registry.npmjs.org/@davnpsh/automata/-/automata-1.2.4.tgz","fileCount":13,"unpackedSize":77007,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUB+HlmCNZ4mMtjyTMdEWeRL/GhOeelwmh0oIWK68CQgIgXLPIh05kwi1amGnnLvmmPFyHuYrcPx3AqJX4GSBSleA="}]},"_npmUser":{"name":"davnpsh","email":"remake7972@davnpsh.dev"},"directories":{},"maintainers":[{"name":"davnpsh","email":"remake7972@davnpsh.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/automata_1.2.4_1728331536930_0.9254959832481089"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-14T02:28:32.165Z","modified":"2024-10-07T20:05:37.280Z","1.0.0":"2024-09-14T02:28:32.463Z","1.0.1":"2024-09-14T04:56:28.473Z","1.0.2":"2024-09-15T01:09:20.582Z","1.0.3":"2024-09-18T16:29:53.220Z","1.0.4":"2024-09-18T16:58:03.263Z","1.1.0":"2024-09-19T03:49:09.518Z","1.2.0":"2024-09-23T01:32:32.626Z","1.2.1":"2024-09-23T01:53:09.486Z","1.2.2":"2024-09-29T19:06:04.768Z","1.2.3":"2024-09-29T20:37:38.291Z","1.2.4":"2024-10-07T20:05:37.084Z"},"author":{"name":"davnpsh"},"license":"GPL-3.0","keywords":["dfa","udfa","nfa","mdfa","automata","automaton","library"],"description":"Automaton generator from regular expressions","maintainers":[{"name":"davnpsh","email":"remake7972@davnpsh.dev"}],"readme":"# automata\n\n[![npm](https://img.shields.io/badge/package%20-%20red?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/package/@davnpsh/automata)\n\n\nThis npm package provides a way to create and manipulate finite automatons based on regular expressions.\n\n## Install\n\n```sh\nnpm install @davnpsh/automata\n```\n\n## Usage\n\nThe NFA (Nondeterministic Finite Automaton) object allows you to create a NFA from a regular expression string.\n\n```js\nimport { NFA } from '@davnpsh/automata';\n\nconst nfa = new NFA('a(b|c)*');\n```\n\nYou can also create a DFA from a regular expression string.\n\n```js\nimport { uDFA, mDFA } from '@davnpsh/automata';\n\nconst udfa = new uDFA('a(b|c)*'); // Unoptimised DFA\nconst mdfa = new mDFA('a(b|c)*'); // Minimised DFA\n```\n\nIn both cases, you can traverse the automaton given the `initial_state` attribute and going through the `next` attribute,\nwhich is an array of edges.\n\n## Configuration\n\nThese objects can also be configured.\n\n```js\nimport { NFA } from '@davnpsh/automata';\n\nconst nfa = new NFA('a(b|c)*', {\n  // Custom empty symbol\n  empty_symbol: \"&\"\n});\n```\n\n## Test\n\nYou can test the automaton with a string.\n\n```js\nimport { mDFA } from '@davnpsh/automata';\n\nconst mdfa = new mDFA('a(b|c)*');\nmdfa.test(\"ab\");\n```\n\nIt returns an object with the `accept` attribute and the `routes` attribute, which is an array of arrays of transitions.\n\n## Graph\n\nYou can also get the graph of the automaton in a format compatible with [Cytoscape](https://js.cytoscape.org/).\n\n```js\nimport { mDFA } from '@davnpsh/automata';\n\nconst mdfa = new mDFA('a(b|c)*');\nmdfa.cytograph(); // Cytoscape elements format\n```\n\nIt is recommended to import the stylesheet and the layout into your project.\n\n```js\nimport { cytoscape_styles, cytoscape_layout } from '@davnpsh/automata';\n\n// Use it on your cytoscape component.\n// For example, in React:\n\n// IMPORTANT: To use the provided layout, you must import cytoscape-dagre\nCytoscape.use(dagre);\n\nconst Graph = () => {\n  return (\n    <CytoscapeComponent\n      elements={mdfa.cytograph()}\n      style={{ width: \"100%\", height: \"100%\" }}\n      stylesheet={cytoscape_styles}\n      layout={cytoscape_layout}\n    />\n  );\n};\n```\n","readmeFilename":"README.md"}