{
  "_id": "fastparse",
  "maintainers": [
    {
      "name": "sokra",
      "email": "tobias.koppers@googlemail.com"
    }
  ],
  "keywords": [
    "parser",
    "regexp"
  ],
  "dist-tags": {
    "latest": "1.1.2"
  },
  "author": {
    "name": "Tobias Koppers @sokra"
  },
  "_rev": "9-4f2ba81616824a89df8d728eaa906cdf",
  "description": "A very simple and stupid parser, based on a statemachine and regular expressions.",
  "readme": "# fastparse\n\nA very simple and stupid parser, based on a statemachine and regular expressions.\n\nIt's not intended for complex languages. It's intended to easily write a simple parser for a simple language.\n\n\n\n## Usage\n\nPass a description of statemachine to the constructor. The description must be in this form:\n\n``` javascript\nnew Parser(description)\n\ndescription is {\n\t// The key is the name of the state\n\t// The value is an object containing possible transitions\n\t\"state-name\": {\n\t\t// The key is a regular expression\n\t\t// If the regular expression matches the transition is executed\n\t\t// The value can be \"true\", a other state name or a function\n\n\t\t\"a\": true,\n\t\t// true will make the parser stay in the current state\n\t\t\n\t\t\"b\": \"other-state-name\",\n\t\t// a string will make the parser transit to a new state\n\t\t\n\t\t\"[cde]\": function(match, index, matchLength) {\n\t\t\t// \"match\" will be the matched string\n\t\t\t// \"index\" will be the position in the complete string\n\t\t\t// \"matchLength\" will be \"match.length\"\n\t\t\t\n\t\t\t// \"this\" will be the \"context\" passed to the \"parse\" method\"\n\t\t\t\n\t\t\t// A new state name (string) can be returned\n\t\t\treturn \"other-state-name\";\n\t\t},\n\t\t\n\t\t\"([0-9]+)(\\\\.[0-9]+)?\": function(match, first, second, index, matchLength) {\n\t\t\t// groups can be used in the regular expression\n\t\t\t// they will match to arguments \"first\", \"second\"\n\t\t},\n\t\t\n\t\t// the parser stops when it cannot match the string anymore\n\t\t\n\t\t// order of keys is the order in which regular expressions are matched\n\t\t// if the javascript runtime preserves the order of keys in an object\n\t\t// (this is not standardized, but it's a de-facto standard)\n\t}\n}\n```\n\nThe statemachine is compiled down to a single regular expression per state. So basically the parsing work is delegated to the (native) regular expression logic of the javascript runtime.\n\n\n``` javascript\nParser.prototype.parse(initialState: String, parsedString: String, context: Object)\n```\n\n`initialState`: state where the parser starts to parse.\n\n`parsedString`: the string which should be parsed.\n\n`context`: an object which can be used to save state and results. Available as `this` in transition functions.\n\nreturns `context`\n\n\n\n\n## Example\n\n``` javascript\nvar Parser = require(\"fastparse\");\n\n// A simple parser that extracts @licence ... from comments in a JS file\nvar parser = new Parser({\n\t// The \"source\" state\n\t\"source\": {\n\t\t// matches comment start\n\t\t\"/\\\\*\": \"comment\",\n\t\t\"//\": \"linecomment\",\n\t\t\n\t\t// this would be necessary for a complex language like JS\n\t\t// but omitted here for simplicity\n\t\t// \"\\\"\": \"string1\",\n\t\t// \"\\'\": \"string2\",\n\t\t// \"\\/\": \"regexp\"\n\t\t\n\t},\n\t// The \"comment\" state\n\t\"comment\": {\n\t\t\"\\\\*/\": \"source\",\n\t\t\"@licen[cs]e\\\\s((?:[^*\\n]|\\\\*+[^*/\\n])*)\": function(match, licenseText) {\n\t\t\tthis.licences.push(licenseText.trim());\n\t\t}\n\t},\n\t// The \"linecomment\" state\n\t\"linecomment\": {\n\t\t\"\\n\": \"source\",\n\t\t\"@licen[cs]e\\\\s(.*)\": function(match, licenseText) {\n\t\t\tthis.licences.push(licenseText.trim());\n\t\t}\n\t}\n});\n\nvar licences = parser.parse(\"source\", sourceCode, { licences: [] }).licences;\n\nconsole.log(licences);\n```\n\n\n\n## License\n\nMIT (http://www.opensource.org/licenses/mit-license.php)\n",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/webpack/fastparse.git"
  },
  "users": {
    "arteffeckt": true
  },
  "bugs": {
    "url": "https://github.com/webpack/fastparse/issues"
  },
  "license": "MIT",
  "versions": {
    "1.0.0": {
      "name": "fastparse",
      "version": "1.0.0",
      "description": "A very simple and stupid parser, based on a statemachine and regular expressions.",
      "main": "index.js",
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
      },
      "repository": {
        "type": "git",
        "url": "git@github.com:webpack/fastparse.git"
      },
      "keywords": [
        "parser",
        "regexp"
      ],
      "author": {
        "name": "Tobias Koppers @sokra"
      },
      "license": "MIT",
      "bugs": {
        "url": "https://github.com/webpack/fastparse/issues"
      },
      "homepage": "https://github.com/webpack/fastparse",
      "_id": "fastparse@1.0.0",
      "dist": {
        "shasum": "608dfee3ca4eb609b7b3fc36507418a51dd20a78",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/fastparse/-/fastparse-1.0.0.tgz",
        "integrity": "sha512-dz5RySsc2SrrHRwfyDG6U+gTBqpJiIeXP6z+FRDraD1HDCZHOmRaGMz2NuWCrUdDYG+eXmryfiLNJVGgtgQ/fg==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEUCIG7m0WVK0rB4AwcO/H61qS+hssY4a3Qhh1xLOWpWPKnTAiEA9Z/I9KW2fEL7vHKXfumtrucxA0Wc59NMFM+TXuKHYiU="
          }
        ]
      },
      "_from": ".",
      "_npmVersion": "1.4.3",
      "_npmUser": {
        "name": "sokra",
        "email": "tobias.koppers@googlemail.com"
      },
      "maintainers": [
        {
          "name": "sokra",
          "email": "tobias.koppers@googlemail.com"
        }
      ],
      "directories": {}
    },
    "1.1.0": {
      "name": "fastparse",
      "version": "1.1.0",
      "description": "A very simple and stupid parser, based on a statemachine and regular expressions.",
      "main": "lib/Parser.js",
      "scripts": {
        "pretest": "npm run lint",
        "test": "mocha",
        "travis": "npm run cover -- --report lcovonly",
        "lint": "eslint lib",
        "precover": "npm run lint",
        "cover": "istanbul cover node_modules/mocha/bin/_mocha",
        "publish-patch": "mocha && npm version patch && git push && git push --tags && npm publish"
      },
      "repository": {
        "type": "git",
        "url": "git+https://github.com/webpack/fastparse.git"
      },
      "keywords": [
        "parser",
        "regexp"
      ],
      "author": {
        "name": "Tobias Koppers @sokra"
      },
      "license": "MIT",
      "bugs": {
        "url": "https://github.com/webpack/fastparse/issues"
      },
      "homepage": "https://github.com/webpack/fastparse",
      "devDependencies": {
        "coveralls": "^2.11.2",
        "eslint": "^0.21.2",
        "istanbul": "^0.3.14",
        "mocha": "^2.2.5",
        "should": "^6.0.3"
      },
      "gitHead": "7d9f6dfa15ba17ab8091fa383b3ff796ab16f29d",
      "_id": "fastparse@1.1.0",
      "_shasum": "02fcf0b63867c557bf986f0106a5912ea47f80fb",
      "_from": ".",
      "_npmVersion": "2.10.0",
      "_nodeVersion": "0.12.2",
      "_npmUser": {
        "name": "sokra",
        "email": "tobias.koppers@googlemail.com"
      },
      "maintainers": [
        {
          "name": "sokra",
          "email": "tobias.koppers@googlemail.com"
        }
      ],
      "dist": {
        "shasum": "02fcf0b63867c557bf986f0106a5912ea47f80fb",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/fastparse/-/fastparse-1.1.0.tgz",
        "integrity": "sha512-QrrNeEZhPwy/W3rDzrf9tF29dWEDygBUSfQC5PD/dpHbGR516bhYaoxNNZ1i3HLusOSl01wNxkj3K6cXtpT2fQ==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEUCIBJnFoGBXFXcs31oSTKTHc0esk1k1TagZeYIPucdauSiAiEAk8JNWAOK8vWUXZEfq7JeELjO1u0XCtWYwh0WZD2m/6o="
          }
        ]
      },
      "directories": {}
    },
    "1.1.1": {
      "name": "fastparse",
      "version": "1.1.1",
      "description": "A very simple and stupid parser, based on a statemachine and regular expressions.",
      "main": "lib/Parser.js",
      "scripts": {
        "pretest": "npm run lint",
        "test": "mocha",
        "travis": "npm run cover -- --report lcovonly",
        "lint": "eslint lib",
        "precover": "npm run lint",
        "cover": "istanbul cover node_modules/mocha/bin/_mocha",
        "publish-patch": "mocha && npm version patch && git push && git push --tags && npm publish"
      },
      "repository": {
        "type": "git",
        "url": "git+https://github.com/webpack/fastparse.git"
      },
      "keywords": [
        "parser",
        "regexp"
      ],
      "author": {
        "name": "Tobias Koppers @sokra"
      },
      "license": "MIT",
      "bugs": {
        "url": "https://github.com/webpack/fastparse/issues"
      },
      "homepage": "https://github.com/webpack/fastparse",
      "devDependencies": {
        "coveralls": "^2.11.2",
        "eslint": "^0.21.2",
        "istanbul": "^0.3.14",
        "mocha": "^2.2.5",
        "should": "^6.0.3"
      },
      "gitHead": "9206e0921135115b6941f3174530fafa40287e44",
      "_id": "fastparse@1.1.1",
      "_shasum": "d1e2643b38a94d7583b479060e6c4affc94071f8",
      "_from": ".",
      "_npmVersion": "2.10.0",
      "_nodeVersion": "0.12.2",
      "_npmUser": {
        "name": "sokra",
        "email": "tobias.koppers@googlemail.com"
      },
      "maintainers": [
        {
          "name": "sokra",
          "email": "tobias.koppers@googlemail.com"
        }
      ],
      "dist": {
        "shasum": "d1e2643b38a94d7583b479060e6c4affc94071f8",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/fastparse/-/fastparse-1.1.1.tgz",
        "integrity": "sha512-rAsw6GG6EgEehUbofs7Aq5RZTJ8qGAVcujXrbf5CjJbk4Vo75IFlqkMamG4bbKwIWAvyQpAZ/CpW9tEj0eaTHQ==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEQCICf58deHY5swa/TCW8saxCo8orEQB0Z/VABSa2lFECS6AiAZGTZ3sIOQS5cakJ9Ffq5f1+aGcrgbT0MVofc2QM/bZA=="
          }
        ]
      },
      "directories": {}
    },
    "1.1.2": {
      "name": "fastparse",
      "version": "1.1.2",
      "description": "A very simple and stupid parser, based on a statemachine and regular expressions.",
      "main": "lib/Parser.js",
      "scripts": {
        "pretest": "npm run lint",
        "test": "mocha",
        "travis": "npm run cover -- --report lcovonly",
        "lint": "eslint lib",
        "precover": "npm run lint",
        "cover": "istanbul cover node_modules/mocha/bin/_mocha",
        "publish-patch": "mocha && npm version patch && git push && git push --tags && npm publish"
      },
      "repository": {
        "type": "git",
        "url": "git+https://github.com/webpack/fastparse.git"
      },
      "keywords": [
        "parser",
        "regexp"
      ],
      "author": {
        "name": "Tobias Koppers @sokra"
      },
      "license": "MIT",
      "bugs": {
        "url": "https://github.com/webpack/fastparse/issues"
      },
      "homepage": "https://github.com/webpack/fastparse",
      "devDependencies": {
        "coveralls": "^2.11.2",
        "eslint": "^0.21.2",
        "istanbul": "^0.3.14",
        "mocha": "^2.2.5",
        "should": "^6.0.3"
      },
      "gitHead": "85d8fa8a49e0a4a08cf884ec854f0d834cab817a",
      "_id": "fastparse@1.1.2",
      "_npmVersion": "5.6.0",
      "_nodeVersion": "8.11.4",
      "_npmUser": {
        "name": "sokra",
        "email": "tobias.koppers@googlemail.com"
      },
      "dist": {
        "integrity": "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==",
        "shasum": "91728c5a5942eced8531283c79441ee4122c35a9",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/fastparse/-/fastparse-1.1.2.tgz",
        "fileCount": 4,
        "unpackedSize": 7843,
        "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2Gw6CRA9TVsSAnZWagAA1aoP/3Zr21YvZaP9zyTe/FLA\njlpbXRmObbMUb0Vsr/XmmTOILAE46NX+aSscH6y+oeZEKqjF1eYYKiwv1HWu\nXGUesXH0je5c1kCCVQTN8CwlNfT+n4B2lpw6dFjFhiOdxblVA21HFMLDRyFJ\n1OBmf4Cd+JlVBR+aYNqQUBFd6KEWh0m5BKNNAYjau4DhKqQdSZ8PsJqnZHN4\ndxb9AKo+GWlMo2axhYvvHYZiBMUKAZ0UH6XvDwGZLr+Pc6ZKF0++C5+XQkhI\nGoqyNCfpRKo7/NjMzwUPf9Gvbe2umfnSXlwXQYxXGcqvSZObFquY+lLj6Zv6\n/yQ1+G95sKXLks7iqj8a8W2rVZ0SGMdu4lzd0PQgxLPYaiEXlJOOcXCOAKEP\nSHPhM0Pn13WMou/r482ui259lZdT8LsWcGUoV046D8RIiPoxMvMkBxEM2AbY\nPEUtpM3DYcRon4Gyft0GlUWDralTRcVk6QqvKK18cn+51QnKIf1cXa4FWiqK\njEp7DJ6XuDFvrxdO3i/TNrrlAy5mln/VuM9BayuqlQXEZc/h+1jNhUTMNvlK\nOZF41KiJqVUIUeOsjjqHaWRgQRvp74NVTj2QdHu7TaT5eNik6tTMbUytOMVd\nTgh6wvOzphSYcez1I7+FQ3SHyoM1MdFKTNxNLcIRY/WyEFl5vERMhleffw5G\n/PoI\r\n=Rl0R\r\n-----END PGP SIGNATURE-----\r\n",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEYCIQDuwSOTf6PJSPhDI+rkVgHMhm8ymv8Q6NA94zD7R28w8QIhAPtZIbBdWC0mKwdkY7kllL6IBaxinXbbxCqGUxZuom2O"
          }
        ]
      },
      "maintainers": [
        {
          "name": "sokra",
          "email": "tobias.koppers@googlemail.com"
        }
      ],
      "directories": {},
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/fastparse_1.1.2_1540910137975_0.2013736910957893"
      },
      "_hasShrinkwrap": false
    }
  },
  "name": "fastparse",
  "time": {
    "modified": "2026-05-24T07:56:24.537Z",
    "created": "2014-08-08T12:02:11.553Z",
    "1.0.0": "2014-08-08T12:02:11.553Z",
    "1.1.0": "2015-05-24T18:57:17.733Z",
    "1.1.1": "2015-05-24T19:32:14.557Z",
    "1.1.2": "2018-10-30T14:35:38.125Z"
  },
  "readmeFilename": "README.md",
  "homepage": "https://github.com/webpack/fastparse"
}