{
  "_id": "parse-svg-path",
  "maintainers": [
    {
      "email": "jkroso@gmail.com",
      "name": "jkroso"
    },
    {
      "email": "matt@mattkarl.com",
      "name": "bigtimebuddy"
    }
  ],
  "keywords": [
    "svg",
    "path",
    "parse",
    "parser"
  ],
  "dist-tags": {
    "latest": "0.2.0"
  },
  "author": {
    "name": "Jake Rosoman"
  },
  "_rev": "14-b73467f98314a9822a6f48e27172bf6e",
  "description": "svg path parser",
  "readme": "# parse-svg-path\n\nA minimal SVG path data parser. Returns a structured array of commands that's easy to iterate and transform.\n\nFor a more full-featured parser see [hughsk/svg-path-parser](//github.com/hughsk/svg-path-parser), or for a streaming parser see [nfroidure/SVGPathData](//github.com/nfroidure/SVGPathData).\n\n## Installation\n\n```sh\nnpm install parse-svg-path\n```\n\n## Usage\n\n```ts\nimport parse from 'parse-svg-path'\n\nconst commands = parse('M10 20 L30 40 Z')\n// [['M', 10, 20], ['L', 30, 40], ['Z']]\n```\n\nEach command is an array whose first element is the command letter (preserving its original case) followed by its numeric arguments.\n\nOverloaded `m`/`M` commands — where more than 2 arguments are provided — are automatically split into an initial move followed by implicit `l`/`L` line commands:\n\n```ts\nparse('m 12.5,52 39,0 0,-40')\n// [['m', 12.5, 52], ['l', 39, 0], ['l', 0, -40]]\n```\n\n## API\n\n### `parse(path: string): Command[]`\n\nParses an SVG path data string and returns an array of commands.\n\n```ts\ntype Command = [string, ...number[]]\n```\n\nThrows an `Error` with the message `\"malformed path data\"` if a command has fewer arguments than required.\n\n### Supported commands\n\n| Letter | Command              | Arguments |\n| ------ | -------------------- | --------- |\n| M / m  | Move to              | x, y      |\n| L / l  | Line to              | x, y      |\n| H / h  | Horizontal line to   | x         |\n| V / v  | Vertical line to     | y         |\n| C / c  | Cubic Bézier curve   | x1, y1, x2, y2, x, y |\n| S / s  | Smooth cubic curve   | x2, y2, x, y |\n| Q / q  | Quadratic Bézier     | x1, y1, x, y |\n| T / t  | Smooth quadratic     | x, y      |\n| A / a  | Arc                  | rx, ry, x-rotation, large-arc, sweep, x, y |\n| Z / z  | Close path           | —         |\n\nUppercase letters use absolute coordinates; lowercase use relative coordinates.\n\n## Development\n\n```sh\nnpm test          # run tests once\nnpm run test:watch  # watch mode\nnpm run build     # build dist/\n```\n\n## Publishing\n\nBump the version, then push — `prepublishOnly` runs the build automatically:\n\n```sh\nnpm version patch  # or minor / major\ngit push && git push --tags\nnpm publish\n```\n",
  "repository": {
    "url": "git://github.com/jkroso/parse-svg-path.git",
    "type": "git"
  },
  "users": {
    "geekbleek": true
  },
  "bugs": {
    "url": "https://github.com/jkroso/parse-svg-path/issues"
  },
  "license": "MIT",
  "versions": {
    "0.1.0": {
      "name": "parse-svg-path",
      "version": "0.1.0",
      "keywords": [
        "svg",
        "path",
        "parse",
        "parser"
      ],
      "author": {
        "name": "Jake Rosoman"
      },
      "license": "MIT",
      "_id": "parse-svg-path@0.1.0",
      "maintainers": [
        {
          "name": "jkroso",
          "email": "jkroso@gmail.com"
        }
      ],
      "bugs": {
        "url": "https://github.com/jkroso/parse-svg-path/issues"
      },
      "dist": {
        "shasum": "2c09d1f5b43e2a4fa2682928ab65a6614dad5b6f",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/parse-svg-path/-/parse-svg-path-0.1.0.tgz",
        "integrity": "sha512-mJVlBkeHLJwM1K8wyuheOATGNWT53MvBUSTgjCJhJ+LgwosKHmPnCbw0qc3NduGwcfzTsPQBMlEKZiVjsM23PA==",
        "signatures": [
          {
            "sig": "MEUCIAD/5fLO4df6n7kSnSzDy7PHkdCGHlc16ZBe/Rl8X08TAiEA9fHUcoeMjocd2L1v84gB4dvccoidAUmlkML4pAzCY+I=",
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
          }
        ]
      },
      "_from": ".",
      "files": [
        "index.js"
      ],
      "_npmUser": {
        "name": "jkroso",
        "email": "jkroso@gmail.com"
      },
      "repository": {
        "url": "git://github.com/jkroso/parse-svg-path.git",
        "type": "git"
      },
      "_npmVersion": "1.3.11",
      "description": "svg path parser",
      "directories": {},
      "dependencies": {},
      "devDependencies": {
        "chai": "*",
        "mocha": "*",
        "serve": "jkroso/serve#1.5.1"
      }
    },
    "0.1.1": {
      "name": "parse-svg-path",
      "version": "0.1.1",
      "keywords": [
        "svg",
        "path",
        "parse",
        "parser"
      ],
      "author": {
        "name": "Jake Rosoman"
      },
      "license": "MIT",
      "_id": "parse-svg-path@0.1.1",
      "maintainers": [
        {
          "name": "jkroso",
          "email": "jkroso@gmail.com"
        }
      ],
      "bugs": {
        "url": "https://github.com/jkroso/parse-svg-path/issues"
      },
      "dist": {
        "shasum": "59399f0984aa17966b884fc3a195e9d3726080ae",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/parse-svg-path/-/parse-svg-path-0.1.1.tgz",
        "integrity": "sha512-a9mZH/oGq29i4zA7a3nGkHzbU2z1nfkk20gaqfS06Va9qmrBcuIqx6cnQgFlp5PDEcUZ08rOFK29iju3P3Ht3Q==",
        "signatures": [
          {
            "sig": "MEQCIDb155WBDAW7jvT7iXTfEZL0DGPd/KtxC/q8luXCspBRAiBSmjbgKQ7RByAOSYFD3HM3zYEY/wetiEoEa8lzfSjfvQ==",
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
          }
        ]
      },
      "_from": ".",
      "files": [
        "index.js"
      ],
      "_npmUser": {
        "name": "jkroso",
        "email": "jkroso@gmail.com"
      },
      "repository": {
        "url": "git://github.com/jkroso/parse-svg-path.git",
        "type": "git"
      },
      "_npmVersion": "1.3.11",
      "description": "svg path parser",
      "directories": {},
      "dependencies": {},
      "devDependencies": {
        "chai": "*",
        "mocha": "*",
        "serve": "jkroso/serve#1.5.1"
      }
    },
    "0.1.2": {
      "name": "parse-svg-path",
      "version": "0.1.2",
      "keywords": [
        "svg",
        "path",
        "parse",
        "parser"
      ],
      "author": {
        "name": "Jake Rosoman"
      },
      "license": "MIT",
      "_id": "parse-svg-path@0.1.2",
      "maintainers": [
        {
          "name": "jkroso",
          "email": "jkroso@gmail.com"
        }
      ],
      "homepage": "https://github.com/jkroso/parse-svg-path#readme",
      "bugs": {
        "url": "https://github.com/jkroso/parse-svg-path/issues"
      },
      "dist": {
        "shasum": "7a7ec0d1eb06fa5325c7d3e009b859a09b5d49eb",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/parse-svg-path/-/parse-svg-path-0.1.2.tgz",
        "integrity": "sha512-JyPSBnkTJ0AI8GGJLfMXvKq42cj5c006fnLz6fXy6zfoVjJizi8BNTpu8on8ziI1cKy9d9DGNuY17Ce7wuejpQ==",
        "signatures": [
          {
            "sig": "MEQCIFEPBn/2+pKMpNUuqMqSsuITbGXznr8SQLSGPdqVi8aLAiBtYmoZGqBY0JLjrsk2WyGcaSge8TxQMJyA8Xjw/eUg6Q==",
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
          }
        ]
      },
      "_from": ".",
      "files": [
        "index.js"
      ],
      "_shasum": "7a7ec0d1eb06fa5325c7d3e009b859a09b5d49eb",
      "gitHead": "53d68840a2d126b1940a58d7314606f5b79dbaa9",
      "scripts": {},
      "_npmUser": {
        "name": "jkroso",
        "email": "jkroso@gmail.com"
      },
      "repository": {
        "url": "git://github.com/jkroso/parse-svg-path.git",
        "type": "git"
      },
      "_npmVersion": "3.6.0",
      "description": "svg path parser",
      "directories": {},
      "_nodeVersion": "5.6.0",
      "dependencies": {},
      "devDependencies": {
        "chai": "*",
        "mocha": "*",
        "serve": "github:jkroso/serve#1.5.1"
      },
      "_npmOperationalInternal": {
        "tmp": "tmp/parse-svg-path-0.1.2.tgz_1472942450918_0.31786097795702517",
        "host": "packages-12-west.internal.npmjs.com"
      }
    },
    "0.2.0": {
      "name": "parse-svg-path",
      "version": "0.2.0",
      "keywords": [
        "svg",
        "path",
        "parse",
        "parser"
      ],
      "author": {
        "name": "Jake Rosoman"
      },
      "license": "MIT",
      "_id": "parse-svg-path@0.2.0",
      "maintainers": [
        {
          "name": "jkroso",
          "email": "jkroso@gmail.com"
        }
      ],
      "homepage": "https://github.com/jkroso/parse-svg-path#readme",
      "bugs": {
        "url": "https://github.com/jkroso/parse-svg-path/issues"
      },
      "dist": {
        "shasum": "38bc8747e7aa32327ae2579c331b161c4867a167",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/parse-svg-path/-/parse-svg-path-0.2.0.tgz",
        "fileCount": 7,
        "integrity": "sha512-Tf7FFIrguPKQwzD4pWnYkR2VOv3raoHeKED80Bm+BYHI3KxC8KsgsGC5+fSMzAGDA6UEk4bHvmi+RsjmL3khpg==",
        "signatures": [
          {
            "sig": "MEQCIBE9QlCRHsx8TiAH3TWz4fOvVhwCn17zIOcU87X6NVigAiB5Eutc0puFDZ18xLu5/EC21nm/oWiliWmKAUNI2Mj5Gg==",
            "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
          }
        ],
        "unpackedSize": 9370
      },
      "main": "./dist/index.cjs",
      "type": "module",
      "types": "./dist/index.d.mts",
      "module": "./dist/index.mjs",
      "exports": {
        ".": {
          "import": {
            "types": "./dist/index.d.mts",
            "default": "./dist/index.mjs"
          },
          "require": {
            "types": "./dist/index.d.cts",
            "default": "./dist/index.cjs"
          }
        }
      },
      "gitHead": "1e87dfc7746f807b61294b941c8c8560df7f11be",
      "scripts": {
        "test": "tsc && vitest run",
        "build": "tsdown --dts --format esm,cjs --clean",
        "prebuild": "npm test",
        "prepublishOnly": "npm run build"
      },
      "_npmUser": {
        "name": "jkroso",
        "email": "jkroso@gmail.com"
      },
      "repository": {
        "url": "git://github.com/jkroso/parse-svg-path.git",
        "type": "git"
      },
      "_npmVersion": "11.12.1",
      "description": "svg path parser",
      "directories": {},
      "_nodeVersion": "26.0.0",
      "_hasShrinkwrap": false,
      "devDependencies": {
        "tsdown": "^0.22.1",
        "vitest": "^4.1.8",
        "typescript": "^6.0.3"
      },
      "_npmOperationalInternal": {
        "tmp": "tmp/parse-svg-path_0.2.0_1780376996529_0.06778555454551083",
        "host": "s3://npm-registry-packages-npm-production"
      }
    }
  },
  "name": "parse-svg-path",
  "time": {
    "created": "2013-11-23T03:00:29.218Z",
    "modified": "2026-06-05T22:04:54.150Z",
    "0.1.0": "2013-11-23T03:00:34.864Z",
    "0.1.1": "2013-12-01T06:31:16.198Z",
    "0.1.2": "2016-09-03T22:40:51.190Z",
    "0.2.0": "2026-06-02T05:09:56.682Z"
  },
  "readmeFilename": "README.md",
  "homepage": "https://github.com/jkroso/parse-svg-path#readme"
}