{
  "_id": "block-stream2",
  "maintainers": [
    {
      "email": "feross@feross.org",
      "name": "feross"
    }
  ],
  "keywords": [
    "stream",
    "block",
    "chunk",
    "size",
    "streams2",
    "streams3"
  ],
  "dist-tags": {
    "latest": "2.1.0"
  },
  "author": {
    "name": "James Halliday",
    "email": "mail@substack.net",
    "url": "http://substack.net"
  },
  "_rev": "11-fac6c66ff44ee158514d7e514407912b",
  "description": "transform input into equally-sized blocks of output",
  "readme": "# block-stream2\n\ntransform input into equally-sized chunks as output\n\nstreams3 version of\n[block-stream](https://npmjs.org/package/block-stream)\n\n[![build status](https://secure.travis-ci.org/substack/block-stream2.png)](http://travis-ci.org/substack/block-stream2)\n\n# example\n\n``` js\nconst BlockStream = require('block-stream2');\nconst through = require('through2');\n\nprocess.stdin\n    .pipe(new BlockStream({ size: 16, zeroPadding: true }))\n    .pipe(through((buf, enc, next) => {\n        const str = buf.toString().replace(/[\\x00-\\x1f]/g, chr);\n        console.log(`buf[${buf.length}]=${str}`);\n        next();\n    }))\n;\nfunction chr (s) { return `\\\\x${pad(s.charCodeAt(0).toString(16),2)}` }\nfunction pad (s, n) { return Array(n - s.length + 1).join('0') + s }\n```\n\n```\n$ echo {c,d,f}{a,e,i,o,u}{t,g,r} | node example/stream.js\nbuf[16]=cat cag car cet\nbuf[16]=ceg cer cit cig\nbuf[16]=cir cot cog cor\nbuf[16]=cut cug cur dat\nbuf[16]=dag dar det deg\nbuf[16]=der dit dig dir\nbuf[16]=dot dog dor dut\nbuf[16]=dug dur fat fag\nbuf[16]=far fet feg fer\nbuf[16]=fit fig fir fot\nbuf[16]=fog for fut fug\nbuf[16]=fur\\x0a\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\n```\n\n# methods\n\n``` js\nconst BlockStream = require('block-stream2');\n```\n\n## const b = new BlockStream(opts)\n## const b = new BlockStream(size, opts)\n\nCreate a new transform stream `b` that outputs chunks of length `size` or\n`opts.size`.\n\nWhen `opts.zeroPadding` is false, do not zero-pad the last chunk.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install block-stream2\n```\n\n# license\n\nMIT\n",
  "repository": {
    "type": "git",
    "url": "git://github.com/substack/block-stream2.git"
  },
  "users": {
    "roccomuso": true
  },
  "bugs": {
    "url": "https://github.com/substack/block-stream2/issues"
  },
  "license": "MIT",
  "versions": {
    "1.0.0": {
      "name": "block-stream2",
      "version": "1.0.0",
      "description": "transform input into equally-sized blocks of output",
      "main": "index.js",
      "dependencies": {
        "defined": "~0.0.0",
        "inherits": "^2.0.1",
        "readable-stream": "^1.0.33"
      },
      "devDependencies": {
        "tape": "^3.0.3"
      },
      "scripts": {
        "test": "tape test/*.js"
      },
      "repository": {
        "type": "git",
        "url": "git://github.com/substack/block-stream2.git"
      },
      "homepage": "https://github.com/substack/block-stream2",
      "keywords": [
        "stream",
        "block",
        "chunk",
        "size",
        "streams2"
      ],
      "author": {
        "name": "James Halliday",
        "email": "mail@substack.net",
        "url": "http://substack.net"
      },
      "license": "MIT",
      "gitHead": "16f711320cebafb4b0833de08b13139bab8f791b",
      "bugs": {
        "url": "https://github.com/substack/block-stream2/issues"
      },
      "_id": "block-stream2@1.0.0",
      "_shasum": "149f24a220b68838aa59222ec8b817ee62301c48",
      "_from": ".",
      "_npmVersion": "2.1.16",
      "_nodeVersion": "0.10.35",
      "_npmUser": {
        "name": "substack",
        "email": "mail@substack.net"
      },
      "maintainers": [
        {
          "name": "substack",
          "email": "mail@substack.net"
        }
      ],
      "dist": {
        "shasum": "149f24a220b68838aa59222ec8b817ee62301c48",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/block-stream2/-/block-stream2-1.0.0.tgz",
        "integrity": "sha512-1kyp//J6nlsY4xkNfSTHcvfkU0s78HNFGmaOO47ilaae8PPXEs+nmc+jhONxc17GgKOdM0R7YgEAFpY2Rq8ktA==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEUCIDZ2mbQt/ohl4m/uiTqQ7vDt/lxmW4hZerKajCRaGAumAiEAr+Z1j7U6dl10baEfjEp0v80PBPAyxsl3HjZjm7jMxNk="
          }
        ]
      },
      "directories": {}
    },
    "1.1.0": {
      "name": "block-stream2",
      "version": "1.1.0",
      "description": "transform input into equally-sized blocks of output",
      "main": "index.js",
      "dependencies": {
        "defined": "^1.0.0",
        "inherits": "^2.0.1",
        "readable-stream": "^2.0.4"
      },
      "devDependencies": {
        "tape": "^4.2.2"
      },
      "scripts": {
        "test": "tape test/*.js"
      },
      "repository": {
        "type": "git",
        "url": "git://github.com/substack/block-stream2.git"
      },
      "homepage": "https://github.com/substack/block-stream2",
      "keywords": [
        "stream",
        "block",
        "chunk",
        "size",
        "streams2"
      ],
      "author": {
        "name": "James Halliday",
        "email": "mail@substack.net",
        "url": "http://substack.net"
      },
      "license": "MIT",
      "gitHead": "2516d3952cf8aa991adc9e3e4dd5fc336e78368d",
      "bugs": {
        "url": "https://github.com/substack/block-stream2/issues"
      },
      "_id": "block-stream2@1.1.0",
      "_shasum": "c738e3a91ba977ebb5e1fef431e13ca11d8639e2",
      "_from": ".",
      "_npmVersion": "3.4.1",
      "_nodeVersion": "4.2.1",
      "_npmUser": {
        "name": "substack",
        "email": "substack@gmail.com"
      },
      "dist": {
        "shasum": "c738e3a91ba977ebb5e1fef431e13ca11d8639e2",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/block-stream2/-/block-stream2-1.1.0.tgz",
        "integrity": "sha512-eMCrXzSedV9emy9u8C4Bar0IG04nVRPoseTlXxNlpkio+fTN+wLGj08tpjb8iYKJNyqGr9qzwj90ouDbNvqBGw==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEUCIQDGC4gzTifUJCdwMbwt0I8ZZ3/p8Hkrcq4s3cjx7jdWWQIgDNGp6FPAcQQjWk3bDQ7D4yfsCY09aKI/tUZtLQ40FGE="
          }
        ]
      },
      "maintainers": [
        {
          "name": "substack",
          "email": "mail@substack.net"
        }
      ],
      "directories": {}
    },
    "2.0.0": {
      "name": "block-stream2",
      "version": "2.0.0",
      "description": "transform input into equally-sized blocks of output",
      "main": "index.js",
      "dependencies": {
        "readable-stream": "^3.4.0"
      },
      "devDependencies": {
        "tape": "^4.2.2"
      },
      "scripts": {
        "test": "tape test/*.js"
      },
      "repository": {
        "type": "git",
        "url": "git://github.com/substack/block-stream2.git"
      },
      "homepage": "https://github.com/substack/block-stream2",
      "keywords": [
        "stream",
        "block",
        "chunk",
        "size",
        "streams2",
        "streams3"
      ],
      "author": {
        "name": "James Halliday",
        "email": "mail@substack.net",
        "url": "http://substack.net"
      },
      "license": "MIT",
      "gitHead": "e370801b89302000f88f48591729218655c2b535",
      "bugs": {
        "url": "https://github.com/substack/block-stream2/issues"
      },
      "_id": "block-stream2@2.0.0",
      "_nodeVersion": "10.16.0",
      "_npmVersion": "6.9.0",
      "dist": {
        "integrity": "sha512-1oI+RHHUEo64xomy1ozLgVJetFlHkIfQfJzTBQrj6xWnEMEPooeo2fZoqFjp0yzfHMBrgxwgh70tKp6T17+i3g==",
        "shasum": "680b9d357ca8b9d5637f4ec8a41fb5968029108f",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/block-stream2/-/block-stream2-2.0.0.tgz",
        "fileCount": 4,
        "unpackedSize": 4488,
        "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdQ422CRA9TVsSAnZWagAA76EQAIU9JvG8yTQOcwq+HkNc\nkEtK6C7d7tKYBr3f1/NLJJNl55OASySb7Y/KjAPsEgeQL6yz5nq0klhnVK4d\nCXCjAvIcUN/dewX2oYytJNrRRuzAc2slkhJTl7fzq3Slf5UQj99IaTVvybbs\ncYZvbMq2RPa2gX6dM36FN6Oktj1G4XUcAA14AC+c1XXPSM3ONHFfX9VcRHyK\n32NaxBTeAYuu5VWMWPhFqXkMRu1xGwaqevExGStVNK7Y3JsJ9xFXO7eW4x6a\nHGibaHHopVp0hzjBwNQ5O3wWlinNGrY2ZPYp/pV6rmyZ5WDwUd6tNyNrkkRJ\nPZ6anaSVoWf4BLurWzkhR9Ij5BpBvTDaQ05lXHHXpo0XZNgRW3Ok+/yd+IXB\nYMtUARlXBnXrw1NtM2P6xnFZGtzXWa5W6uACFnczrqgcc0teMO3gaXPQZXn4\nuR5TVybSz1QJWwkMBfm/18/pZFB6E2y6xQiS9fpeWzqX3D2Yks5YD1o2aTx6\n1Hl5ltJFUfqqGIGGIM9tILZVugQz4fdhPlzxV59WTbkWc2k0m4G3E0sAARQH\nHLKwoqJjXGx+zEvXU2KUZyuDJTgGhPFevgGZNMGbXkRXijmX8edpwKnTu0BX\nmDwKMRudsIb6zx1Q9fVOVglblL6GC4YqT4/mN5DeHWMXyznJp5GbLnEvLnGK\nlPec\r\n=FBEB\r\n-----END PGP SIGNATURE-----\r\n",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEYCIQDEK5LcwKWrjZKyFjISNC0CSXFDdpFBm9N88s5rZn+kTAIhANgjk4awO1Jh/lLwVrGA3Ooa8gNajiW4CfD8f9BQrMsF"
          }
        ]
      },
      "maintainers": [
        {
          "email": "feross@feross.org",
          "name": "feross"
        },
        {
          "email": "substack@gmail.com",
          "name": "substack"
        }
      ],
      "_npmUser": {
        "name": "feross",
        "email": "feross@feross.org"
      },
      "directories": {},
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/block-stream2_2.0.0_1564708277542_0.8416177987164468"
      },
      "_hasShrinkwrap": false
    },
    "2.1.0": {
      "name": "block-stream2",
      "version": "2.1.0",
      "description": "transform input into equally-sized blocks of output",
      "main": "index.js",
      "dependencies": {
        "readable-stream": "^3.4.0"
      },
      "devDependencies": {
        "standard": "^16.0.3",
        "tape": "^4.2.2"
      },
      "scripts": {
        "test": "standard && tape test/*.js"
      },
      "repository": {
        "type": "git",
        "url": "git://github.com/substack/block-stream2.git"
      },
      "homepage": "https://github.com/substack/block-stream2",
      "keywords": [
        "stream",
        "block",
        "chunk",
        "size",
        "streams2",
        "streams3"
      ],
      "author": {
        "name": "James Halliday",
        "email": "mail@substack.net",
        "url": "http://substack.net"
      },
      "license": "MIT",
      "gitHead": "a0292a5dab5690d2577d24087b3f13b1505042b6",
      "bugs": {
        "url": "https://github.com/substack/block-stream2/issues"
      },
      "_id": "block-stream2@2.1.0",
      "_nodeVersion": "14.15.4",
      "_npmVersion": "6.14.10",
      "dist": {
        "integrity": "sha512-suhjmLI57Ewpmq00qaygS8UgEq2ly2PCItenIyhMqVjo4t4pGzqMvfgJuX8iWTeSDdfSSqS6j38fL4ToNL7Pfg==",
        "shasum": "ac0c5ef4298b3857796e05be8ebed72196fa054b",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/block-stream2/-/block-stream2-2.1.0.tgz",
        "fileCount": 4,
        "unpackedSize": 5228,
        "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgG0cpCRA9TVsSAnZWagAAkqkP/j0dpyfhL0X1DlXIH23B\n2ENJPtAAdYHom4qi2uP/Is/KPax5wLhfKIMT30QJXZ03fQWYWD3VcLJ+lk2h\nO2oL5DJnlfKV7N52xx61l4HoXFrHOFJYYXKxKd8ZjaWmHxv6Qzjod/McbJOe\nrudpyiOQC+jsjYC6f90eWq6HPimwpM+VSQNaFGDCHtwh12x1956QfbPoECkY\nOAh8tod6OL61ZYDWTy2o7VxMK85JmV3b6wE3Qv/8hJqHtTYx4fxE/A2MdCtN\nJhctURRSdV5BFiJoNG/j8WYYIy3zSx3smHKn5fl8cDsdPWRqarlBRv4h0Abh\nlrTXUbfgzpczFdI03XueigqOy2hqWJvFT1KlybDtxT2ZSz2j1wrTbzryQGQk\ncYplGygT8hCkWnnWDoJtB8jToUWquUD1yznQuDIgK4j+A/ywq5GJhvibuMb/\nXkcEyQ6CXBZ6aIJe2rtikEEjvQxT5x1ix+p+YTHEW8oqN3gE1MKz+jPDw0WT\nm8Er+VIWFz3aS26KfmQYAlvanQOYMMu+mJYKugQT9iZhRMVT7+QpTMtymgbR\na1Z+GEBxlAqnqKw+TgTh3X9ngQsurXbOkNZkHedv5bL4r6+f67duNlz+JOG6\no0v9q+EhTr+pys1IXBZ5VLECV9DNKf+Ob4DFYMOWybb7Z0Syk0TOvNUNGmQ5\n8bUH\r\n=srUl\r\n-----END PGP SIGNATURE-----\r\n",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEUCIB7JKwxS2zI/I5x7pvrwPdHXP5fHjbLmSm/chvbKLGe5AiEAqBDX5yi3OnvO8me1JmHPh302sRLdJEyG7XDN5HGYUCU="
          }
        ]
      },
      "_npmUser": {
        "name": "feross",
        "email": "feross@feross.org"
      },
      "directories": {},
      "maintainers": [
        {
          "name": "feross",
          "email": "feross@feross.org"
        },
        {
          "name": "substack",
          "email": "substack@gmail.com"
        }
      ],
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/block-stream2_2.1.0_1612400425358_0.5874287235233888"
      },
      "_hasShrinkwrap": false
    }
  },
  "name": "block-stream2",
  "time": {
    "modified": "2026-05-13T07:49:04.260Z",
    "created": "2015-01-24T10:00:58.060Z",
    "1.0.0": "2015-01-24T10:00:58.060Z",
    "1.1.0": "2015-12-13T23:24:45.905Z",
    "2.0.0": "2019-08-02T01:11:17.694Z",
    "2.1.0": "2021-02-04T01:00:25.467Z"
  },
  "readmeFilename": "readme.markdown",
  "homepage": "https://github.com/substack/block-stream2"
}