{
  "manifest": {
    "name": "@leichtgewicht/ip-codec",
    "version": "2.0.5",
    "description": "Small package to encode or decode IP addresses from buffers to strings.",
    "main": "index.cjs",
    "types": "types",
    "exports": {
      ".": {
        "types": "./types/index.d.ts",
        "import": "./index.mjs",
        "require": "./index.cjs"
      }
    },
    "scripts": {
      "lint": "standard && dtslint --localTs node_modules/typescript/lib types",
      "test": "npm run lint && npm run unit",
      "unit": "fresh-tape test.mjs",
      "coverage": "c8 npm run unit",
      "prepare": "npx @leichtgewicht/esm2umd ipCodec"
    },
    "repository": {
      "type": "git",
      "url": "git+https://github.com/martinheidegger/ip-codec.git"
    },
    "keywords": [
      "ip",
      "ipv4",
      "ipv6",
      "codec",
      "codecs",
      "buffer",
      "conversion"
    ],
    "author": {
      "name": "Martin Heidegger"
    },
    "license": "MIT",
    "bugs": {
      "url": "https://github.com/martinheidegger/ip-codec/issues"
    },
    "homepage": "https://github.com/martinheidegger/ip-codec#readme",
    "devDependencies": {
      "@definitelytyped/dtslint": "0.2.19",
      "@leichtgewicht/esm2umd": "^0.4.0",
      "c8": "^9.1.0",
      "fresh-tape": "^5.5.3",
      "standard": "^17.1.0",
      "typescript": "^5.4.3"
    },
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-@leichtgewicht-ip-codec-2.0.5-4fc56c15c580b9adb7dc3c333a134e540b44bfb1-integrity/node_modules/@leichtgewicht/ip-codec/package.json",
    "readmeFilename": "Readme.md",
    "readme": "# @leichtgewicht/ip-codec\n\nSmall package to encode or decode IP addresses from buffers to strings.\nSupports IPV4 and IPV6.\n\n## Usage\n\nThe basics are straigthforward\n\n```js\nimport { encode, decode, sizeOf, familyOf } from '@leichtgewicht/ip-codec'\n\nconst uint8Array = encode(\"127.0.0.1\")\nconst str = decode(uint8Array)\n\ntry {\n  switch sizeOf(str) {\n    case 4: // IPv4\n    case 16: // IPv6\n  }\n  switch familyOf(str) {\n    case: 1: // IPv4\n    case: 2: // IPv6\n  }\n} catch (err) {\n  // Invalid IP\n}\n```\n\nBy default the library will work with Uint8Array's but you can bring your own buffer:\n\n```js\nconst buf = Buffer.alloc(4)\nencode('127.0.0.1', buf)\n```\n\nIt is also possible to de-encode at a location inside a given buffer\n\n```js\nconst buf = Buffer.alloc(10)\nencode('127.0.0.1', buf, 4)\n```\n\nAllocation of a buffer may be difficult if you don't know what type the buffer:\nyou can pass in a generator to allocate it for you:\n\n```js\nencode('127.0.0.1', Buffer.alloc)\n```\n\nYou can also de/encode ipv4 or ipv6 specifically:\n\n```js\nimport { v4, v6 } from '@leichtgewicht/ip-codec'\n\nv4.decode(v4.encode('127.0.0.1'))\nv6.decode(v6.encode('::'))\n```\n\n## History\n\nThe code in this package was originally extracted from [node-ip](https://github.com/indutny/node-ip) and since improved.\n\nNotable changes are the removal of the `Buffer` dependency and better support for detection of\nformats and allocation of buffers.\n\n## License\n\n[MIT](./LICENSE)\n",
    "licenseText": "MIT License\n\nCopyright (c) 2021 Martin Heidegger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz#4fc56c15c580b9adb7dc3c333a134e540b44bfb1",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz",
    "hash": "4fc56c15c580b9adb7dc3c333a134e540b44bfb1",
    "integrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==",
    "registry": "npm",
    "packageName": "@leichtgewicht/ip-codec",
    "cacheIntegrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw== sha1-T8VsFcWAua233DwzOhNOVAtEv7E="
  },
  "registry": "npm",
  "hash": "4fc56c15c580b9adb7dc3c333a134e540b44bfb1"
}