{"_id":"perseus-custom","_rev":"9-9e7d63b47d4a8cf09ab51689bfe53dde","name":"perseus-custom","dist-tags":{"latest":"0.0.9"},"versions":{"0.0.1":{"name":"perseus-custom","version":"0.0.1","keywords":["parsing","equation","expression","algebra","symbolic"],"author":{"name":"Khan Academy"},"license":"MIT","_id":"perseus-custom@0.0.1","maintainers":[{"name":"sainath9899","email":"sainath@quizizz.com"}],"dist":{"shasum":"f43f2f5f1ba9f71c62bd1e42f6807f162467d619","tarball":"https://registry.npmjs.org/perseus-custom/-/perseus-custom-0.0.1.tgz","fileCount":22,"integrity":"sha512-B9JX5jWgzc2N1iS0Yj7kvmUAZ/ERppsg6ZBNfgJgH+6SVkLJnIFfI79NHf7/hTuwl8SG3RxwU4ibozNsSQXWXA==","signatures":[{"sig":"MEUCIARc4kYgRGILpnrolV5fsPGWvSBEXFcMW5QiiE21SkeWAiEA4YIhwFIfCu+uNZUI6hov9BqTdghGbJ+OYknGa6jVZHY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":272071},"main":"dist/index.js","module":"dist/es/index.js","source":"src/index.js","gitHead":"830ec316ec2a2619e2876bee0b32bc2f201ad1a2","scripts":{"test":"bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'","gen:parsers":"node src/parser-generator.js"},"_npmUser":{"name":"sainath9899","email":"sainath@quizizz.com"},"repository":{"type":"git"},"_npmVersion":"11.4.2","description":"A lightweight JavaScript CAS for comparing expressions and equations.","directories":{},"_nodeVersion":"24.3.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jison":"0.4.15","underscore":"1.4.4","perseus-build-settings":"^0.0.5"},"peerDependencies":{"underscore":"1.4.4"},"_npmOperationalInternal":{"tmp":"tmp/perseus-custom_0.0.1_1754041725364_0.18503292170516317","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"perseus-custom","version":"0.0.2","keywords":["parsing","equation","expression","algebra","symbolic"],"author":{"name":"Khan Academy"},"license":"MIT","_id":"perseus-custom@0.0.2","maintainers":[{"name":"sainath9899","email":"sainath@quizizz.com"}],"dist":{"shasum":"5762dfd3a1ca71a6884e236c498c0de7b26a84f0","tarball":"https://registry.npmjs.org/perseus-custom/-/perseus-custom-0.0.2.tgz","fileCount":22,"integrity":"sha512-mk/s8KGXODNaAQuJ2fnE8jh6iHNyy71p+LT7gMs6S9Xgh3K85CBaBnMRcNW1JO2zO2RlUv6L4JCCos681DL+Rg==","signatures":[{"sig":"MEYCIQC0qXFokm2b3+MEiQeZkzINApa9ggylqG7ZqWiy8WjAYAIhAPwIVFHdvCrVMTW9bTBKK2caoqnySIRmilzxjIIaTss2","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":272071},"main":"dist/index.js","module":"dist/es/index.js","source":"src/index.js","gitHead":"830ec316ec2a2619e2876bee0b32bc2f201ad1a2","scripts":{"test":"bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'","gen:parsers":"node src/parser-generator.js"},"_npmUser":{"name":"sainath9899","email":"sainath@quizizz.com"},"repository":{"type":"git"},"_npmVersion":"11.4.2","description":"A lightweight JavaScript CAS for comparing expressions and equations.","directories":{},"_nodeVersion":"24.3.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jison":"0.4.15","underscore":"1.4.4","perseus-build-settings":"^0.0.5"},"peerDependencies":{"underscore":"1.4.4"},"_npmOperationalInternal":{"tmp":"tmp/perseus-custom_0.0.2_1754045611681_0.9219203193715608","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"perseus-custom","version":"0.0.3","keywords":["parsing","equation","expression","algebra","symbolic"],"author":{"name":"Khan Academy"},"license":"MIT","_id":"perseus-custom@0.0.3","maintainers":[{"name":"sainath9899","email":"sainath@quizizz.com"}],"dist":{"shasum":"9e5d6c7fba55c170daaa1e9c00007322188c05fe","tarball":"https://registry.npmjs.org/perseus-custom/-/perseus-custom-0.0.3.tgz","fileCount":28,"integrity":"sha512-TLpnvSSYcNksYQ41Ig+eFEMXTWdccjUxXU69mMQd45iyEOCMIwyGz0Ys/FA0GJgbBoxi9rzSnoVXtPMZKGS6ZA==","signatures":[{"sig":"MEUCIQDhPSDSxf0LPoLGshdcLNwjc9c6xnzWYo3A/D5rCxJjiwIgCQNhfWw8eA2+iXuTOCDV5U1gnbPKKYX3nb+8sYtinM8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1401824},"main":"dist/index.js","types":"./dist/index.d.ts","module":"dist/es/index.js","source":"src/index.js","gitHead":"830ec316ec2a2619e2876bee0b32bc2f201ad1a2","scripts":{"test":"bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'","build":"yarn gen:parsers && rollup -c rollup.config.js","gen:parsers":"node src/parser-generator.js"},"_npmUser":{"name":"sainath9899","email":"sainath@quizizz.com"},"repository":{"type":"git"},"_npmVersion":"11.4.2","description":"A lightweight JavaScript CAS for comparing expressions and equations.","directories":{},"_nodeVersion":"24.3.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jison":"0.4.15","underscore":"1.4.4","perseus-build-settings":"^0.0.5"},"peerDependencies":{"underscore":"1.4.4"},"_npmOperationalInternal":{"tmp":"tmp/perseus-custom_0.0.3_1754051969094_0.24268570693644276","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"perseus-custom","version":"0.0.4","keywords":["parsing","equation","expression","algebra","symbolic"],"author":{"name":"Khan Academy"},"license":"MIT","_id":"perseus-custom@0.0.4","maintainers":[{"name":"sainath9899","email":"sainath@quizizz.com"}],"dist":{"shasum":"3117f41eb2e978387dc273d7bcd2fb028903cf7c","tarball":"https://registry.npmjs.org/perseus-custom/-/perseus-custom-0.0.4.tgz","fileCount":27,"integrity":"sha512-gVOFF9mXXWrRXaFSNXBCDqACh51fcF7frQOCkOTD3jtT/n3uyAUAAo7NC2EgLg2rMH77bBIZfpCe+9NZXmiJnw==","signatures":[{"sig":"MEUCIQD14gLY9LqOsyp+NtZ6DlcP73TXB/z8IrCK22sE3j42UAIgEw74HMkxxw15Wc1mmD1Md6cNvhjCB5qjLdxh3isU54E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1397709},"main":"dist/index.js","module":"dist/es/index.js","source":"src/index.js","gitHead":"830ec316ec2a2619e2876bee0b32bc2f201ad1a2","scripts":{"test":"bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'","build":"yarn gen:parsers && rollup -c rollup.config.js","gen:parsers":"node src/parser-generator.js"},"_npmUser":{"name":"sainath9899","email":"sainath@quizizz.com"},"repository":{"type":"git"},"_npmVersion":"11.4.2","description":"A lightweight JavaScript CAS for comparing expressions and equations.","directories":{},"_nodeVersion":"24.3.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jison":"0.4.15","rollup":"^2.70.2","underscore":"1.4.4","@rollup/plugin-babel":"^5.3.0","rollup-plugin-terser":"^7.0.2","perseus-build-settings":"^0.0.5","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-node-resolve":"^13.2.1"},"peerDependencies":{"underscore":"1.4.4"},"_npmOperationalInternal":{"tmp":"tmp/perseus-custom_0.0.4_1754053096093_0.7010222234385781","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"perseus-custom","version":"0.0.5","keywords":["parsing","equation","expression","algebra","symbolic"],"author":{"name":"Khan Academy"},"license":"MIT","_id":"perseus-custom@0.0.5","maintainers":[{"name":"sainath9899","email":"sainath@quizizz.com"}],"dist":{"shasum":"ea4b548d41584ad9a5f8c1a845995ee22dc1c7f3","tarball":"https://registry.npmjs.org/perseus-custom/-/perseus-custom-0.0.5.tgz","fileCount":27,"integrity":"sha512-PKCSOplzkiVyczk0LIDOmTvBlcI9UMNTR2Rg666wWUnyv2Ga2BB1E2VFzzKBAR+5tRudKlVqzgPy29z5lp6+JA==","signatures":[{"sig":"MEUCIQCzgtnc2YzKLWtgoHnJhXG2NUxNklMjHy+PPKSefQyRggIgIE6UvgjxAvIN4Tczj3HuGY63eRQXpJTfBCz6lEjAylE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1397709},"main":"dist/index.js","module":"dist/es/index.js","source":"src/index.js","gitHead":"2b390d609aa69a67e5ca013a8fad91ff60f1b753","scripts":{"test":"bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'","build":"yarn gen:parsers && rollup -c rollup.config.js","gen:parsers":"node src/parser-generator.js"},"_npmUser":{"name":"sainath9899","email":"sainath@quizizz.com"},"repository":{"type":"git"},"_npmVersion":"11.4.2","description":"A lightweight JavaScript CAS for comparing expressions and equations.","directories":{},"_nodeVersion":"24.3.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jison":"0.4.15","rollup":"^2.70.2","underscore":"1.4.4","@rollup/plugin-babel":"^5.3.0","rollup-plugin-terser":"^7.0.2","perseus-build-settings":"^0.0.5","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-node-resolve":"^13.2.1"},"peerDependencies":{"underscore":"1.4.4"},"_npmOperationalInternal":{"tmp":"tmp/perseus-custom_0.0.5_1754053208334_0.20498168583337506","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"perseus-custom","version":"0.0.6","keywords":["parsing","equation","expression","algebra","symbolic"],"author":{"name":"Khan Academy"},"license":"MIT","_id":"perseus-custom@0.0.6","maintainers":[{"name":"sainath9899","email":"sainath@quizizz.com"}],"dist":{"shasum":"0551e5b76c20c6328d518cbd1d80bcdab9b61cb0","tarball":"https://registry.npmjs.org/perseus-custom/-/perseus-custom-0.0.6.tgz","fileCount":27,"integrity":"sha512-gdlXxsQ/5tIt3eBC1gApzKN5blriZCettxjlu6u6pFHD4z0VdgRKfHsg/Ndl++5W7Bkkty5TW61dTnBa3Uf7RA==","signatures":[{"sig":"MEUCIQDw13ZUCjYThLRTuxnoE11I++4FV/aLts3HXWa9wH6dhwIgG6kF62ZkBojDl/UyZYWO5QgPpJ6SBACFjAqvNOTTOgg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1645344},"main":"dist/index.js","module":"dist/es/index.js","source":"src/index.js","gitHead":"ee8db7f63f918f8d262a59b682004efd1dd31179","scripts":{"test":"bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'","build":"yarn gen:parsers && rollup -c rollup.config.js","gen:parsers":"node src/parser-generator.js"},"_npmUser":{"name":"sainath9899","email":"sainath@quizizz.com"},"repository":{"type":"git"},"_npmVersion":"11.4.2","description":"A lightweight JavaScript CAS for comparing expressions and equations.","directories":{},"_nodeVersion":"24.3.0","dependencies":{"underscore":"1.4.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jison":"0.4.15","rollup":"^2.70.2","@rollup/plugin-babel":"^5.3.0","rollup-plugin-terser":"^7.0.2","perseus-build-settings":"^0.0.5","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-node-resolve":"^13.2.1"},"_npmOperationalInternal":{"tmp":"tmp/perseus-custom_0.0.6_1754053336921_0.04630926951078429","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"perseus-custom","version":"0.0.7","keywords":["parsing","equation","expression","algebra","symbolic"],"author":{"name":"Khan Academy"},"license":"MIT","_id":"perseus-custom@0.0.7","maintainers":[{"name":"sainath9899","email":"sainath@quizizz.com"}],"dist":{"shasum":"deb94eb06b7f3b03c2cb15a8bdb259ba5a9a5e0f","tarball":"https://registry.npmjs.org/perseus-custom/-/perseus-custom-0.0.7.tgz","fileCount":54,"integrity":"sha512-GHDOIY59oGGILT/zVMS8epjzpF27IefbL/MDRn/nflYp5f/NK8Hmni8kIUsqOl7HdDU6irQkr3w56T+TlE96gg==","signatures":[{"sig":"MEUCIQCUR9j+BSKKN+ICff6o+Jq7H9TRvAFF53yOGATggo0BxAIgNAy3dIDI0iv1fs5ykMmc8BGELTiAwHdKLi/oZiWRUw0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1656874},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/es/index.js","source":"src/index.js","gitHead":"2c1b516273e25ffef146719cc1f3f3c8991edcdb","scripts":{"test":"bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'","build":"yarn gen:parsers && rollup -c rollup.config.js && cp src/index.d.ts dist/","gen:parsers":"node src/parser-generator.js"},"_npmUser":{"name":"sainath9899","email":"sainath@quizizz.com"},"repository":{"type":"git"},"_npmVersion":"11.4.2","description":"A lightweight JavaScript CAS for comparing expressions and equations.","directories":{},"_nodeVersion":"24.3.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jison":"0.4.15","rollup":"^2.70.2","underscore":"1.4.4","@rollup/plugin-babel":"^5.3.0","rollup-plugin-terser":"^7.0.2","perseus-build-settings":"^0.0.5","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-node-resolve":"^13.2.1"},"_npmOperationalInternal":{"tmp":"tmp/perseus-custom_0.0.7_1754284991868_0.6729295613121122","host":"s3://npm-registry-packages-npm-production"}},"0.0.8":{"name":"perseus-custom","version":"0.0.8","keywords":["parsing","equation","expression","algebra","symbolic"],"author":{"name":"Khan Academy"},"license":"MIT","_id":"perseus-custom@0.0.8","maintainers":[{"name":"sainath9899","email":"sainath@quizizz.com"}],"dist":{"shasum":"d151a6242ce64b9a49176e6ebe10e62037a77ab6","tarball":"https://registry.npmjs.org/perseus-custom/-/perseus-custom-0.0.8.tgz","fileCount":28,"integrity":"sha512-GIF9+o4SR+mPVpPfUsVYC6rFp87LtQPolPinf7fcD8XyahSMcBxV6lOTB06mg0tswZ478gU7u1jJwioLRvAtBg==","signatures":[{"sig":"MEUCIQCDO6L4IkLQl43XfNNtc6cbJXRwq2KyZGieGdL9fRXFrAIgfJjfARzTtb/kMyX3BzAd7XpQv4NQOImsevPzrmda0OY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1794272},"main":"dist/index.js","module":"dist/es/index.js","source":"src/index.js","gitHead":"bc85f7a510537050bfd18d28e14397acd10fb9ba","scripts":{"dev":"npx http-server -p 8000 -c-1","test":"bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'","build":"yarn gen:parsers && rollup -c rollup.config.js","start":"npx http-server -p 8000","gen:parsers":"node src/parser-generator.js"},"_npmUser":{"name":"sainath9899","email":"sainath@quizizz.com"},"repository":{"type":"git"},"_npmVersion":"10.8.2","description":"A lightweight JavaScript CAS for comparing expressions and equations.","directories":{},"_nodeVersion":"20.19.3","dependencies":{"underscore":"1.4.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jison":"0.4.15","rollup":"^2.70.2","@rollup/plugin-babel":"^5.3.0","rollup-plugin-terser":"^7.0.2","perseus-build-settings":"0.0.1-security","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-node-resolve":"^13.2.1"},"_npmOperationalInternal":{"tmp":"tmp/perseus-custom_0.0.8_1755600505518_0.4569696994731349","host":"s3://npm-registry-packages-npm-production"}},"0.0.9":{"name":"perseus-custom","description":"A lightweight JavaScript CAS for comparing expressions and equations.","author":{"name":"Khan Academy"},"license":"MIT","version":"0.0.9","publishConfig":{"access":"public"},"repository":{"type":"git"},"module":"dist/es/index.js","main":"dist/index.js","source":"src/index.js","scripts":{"gen:parsers":"node src/parser-generator.js","build":"yarn gen:parsers && rollup -c rollup.config.js","test":"bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'","start":"npx http-server -p 8000","dev":"npx http-server -p 8000 -c-1"},"dependencies":{"underscore":"1.4.4"},"devDependencies":{"@rollup/plugin-babel":"^5.3.0","@rollup/plugin-commonjs":"^22.0.0","@rollup/plugin-node-resolve":"^13.2.1","jison":"0.4.15","perseus-build-settings":"0.0.1-security","rollup":"^2.70.2","rollup-plugin-terser":"^7.0.2"},"keywords":["parsing","equation","expression","algebra","symbolic"],"_id":"perseus-custom@0.0.9","gitHead":"09552810a1869e2288abcd0d263be93cca2ee3a3","_nodeVersion":"20.19.3","_npmVersion":"10.8.2","dist":{"integrity":"sha512-UToVRzq96qu8URduB4btClhcIBz6ieGvj3X9cSLN7tVkJzA71MVv0TGK/3Ez54UWWUfGEaaqFOq39EFSpKtDfQ==","shasum":"75e72b7e3b4266acf6abe222c7a12158f487f6a5","tarball":"https://registry.npmjs.org/perseus-custom/-/perseus-custom-0.0.9.tgz","fileCount":29,"unpackedSize":2142321,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAPPB9YH+yGT7Ehcgsg4zP7G+j2b2KSeqYEOFdvjTnMZAiBDSJ9M1xV6Aa+w6ia9YC2NefetzLdheuStXiKNVr7g+Q=="}]},"_npmUser":{"name":"sainath9899","email":"sainath@quizizz.com"},"directories":{},"maintainers":[{"name":"sainath9899","email":"sainath@quizizz.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/perseus-custom_0.0.9_1770363331763_0.274420582440581"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-01T09:48:45.242Z","modified":"2026-02-06T07:35:32.065Z","0.0.1":"2025-08-01T09:48:45.544Z","0.0.2":"2025-08-01T10:53:31.887Z","0.0.3":"2025-08-01T12:39:29.323Z","0.0.4":"2025-08-01T12:58:16.353Z","0.0.5":"2025-08-01T13:00:08.707Z","0.0.6":"2025-08-01T13:02:17.262Z","0.0.7":"2025-08-04T05:23:12.077Z","0.0.8":"2025-08-19T10:48:25.768Z","0.0.9":"2026-02-06T07:35:31.941Z"},"author":{"name":"Khan Academy"},"license":"MIT","keywords":["parsing","equation","expression","algebra","symbolic"],"repository":{"type":"git"},"description":"A lightweight JavaScript CAS for comparing expressions and equations.","maintainers":[{"name":"sainath9899","email":"sainath@quizizz.com"}],"readme":"KAS\n===\n\nA lightweight JavaScript CAS (Computer Algebra System) for comparing expressions and equations.\nIt is used throughout [Khan Academy](https://khanacademy.org)'s interactive exercises.\n\nWhat can it do?\n---------------\n\nIt can parse plain text math, LaTeX, or a mix of both:\n\n```js\nvar expr = KAS.parse(\"3x \\\\frac{42}{42} sin^2y\").expr;\nexpr.print();\n// \"3*x*42/42*sin(y)^(2)\"\n```\n\nIt can evaluate expressions:\n\n```js\nvar expr = KAS.parse(\"(x^2+y^2)^.5\").expr;\nexpr.eval({x: 3, y: 4});\n// 5\n```\n\nIt can compare expressions and equations:\n\n```js\nvar expr1 = KAS.parse(\"(1-x)(-1-6x)\").expr;\nvar expr2 = KAS.parse(\"(6x+1)(x-1)\").expr;\nKAS.compare(expr1, expr2).equal;\n// true\n\nvar eq1 = KAS.parse(\"2w+50/w=25\").expr;\nvar eq2 = KAS.parse(\"w(12.5-w)=25\").expr;\nKAS.compare(eq1, eq2).equal;\n// true\n```\n\nIt can perform basic transforms that always simplify an expression:\n\n```js\nvar expr = KAS.parse(\"1+1+x+x+x+y\").expr;\nexpr.collect().print();\n// \"2+3*x+y\"\n\nvar expr = KAS.parse(\"b^(2*y*log_b x)\").expr;\nexpr.collect().print();\n// \"x^(2*y)\"\n```\n\nIt can perform non-simplifying transforms on an expression:\n\n```js\nvar expr = KAS.parse(\"ab(c+d)e^f\").expr;\nexpr.print();\n// \"a*b*(c+d)*e^(f)\"\nexpr.expand().print();\n// \"a*b*e^(f)*c+a*b*e^(f)*d\"\nexpr.expand().factor().print();\n// \"a*b*e^(f)*(c+d)\"\n```\n\nIt can combine the above abilities to perform powerful simplification:\n\n```js\nvar expr = KAS.parse(\"((nx^5)^5)/(n^-2x^2)^-3\").expr;\nexpr.print();\n// \"(n*x^(5))^(5)*(n^(-2)*x^(2))^(-1*-3)\"\nexpr.simplify().print();\n// \"n^(-1)*x^(31)\"\n\nvar expr = KAS.parse(\"(15np-25mp)/(15p^2-5p)+(20mp+10p^2)/(15p^2-5p)\").expr;\nexpr.print();\n// \"(15*n*p+-25*m*p)*(15*p^(2)+-5*p)^(-1)+(20*m*p+10*p^(2))*(15*p^(2)+-5*p)^(-1)\"\nexpr.simplify().print();\n// \"(-1+3*p)^(-1)*(3*n+-1*m+2*p)\"\n```\n\nHow to build the library\n------------------------\n    npm install\n    npm run build\n\nHow to build the parser\n-----------------------\nFirst, make any changes in `src/parser-generator.js`\n\n    npm install\n    npm run build:parser\n\nHow to run tests\n----------------\nFrom the monorepo root, run:\n\n    yarn test packages/kas\n\nIf the monorepo test infrastructure has compatibility issues (e.g., ESM module errors with enzyme/cheerio), you can run kas tests directly with a minimal jest config:\n\n```bash\nnpx jest packages/kas/src/__tests__/parsing_test.js --no-coverage \\\n  --config='{\"testEnvironment\":\"node\",\"transform\":{\"^.+\\\\.jsx?$\":\"<rootDir>/config/test/test.transform.js\"},\"moduleNameMapper\":{\"^@khanacademy/kas$\":\"<rootDir>/packages/kas/src/index.js\"}}'\n```\n\nOr test parsing manually with node:\n\n```bash\ncd packages/kas && yarn build\nnode -e \"\nconst KAS = require('./dist/index.js');\nconsole.log(KAS.parse('(2,3)'));\n// { parsed: true, expr: Coord { x: Int, y: Int } }\n\"\n```\n\nLicense\n-------\n[MIT License](http://opensource.org/licenses/MIT)\n","readmeFilename":"README.md"}