{"name":"libbase64","version":"1.3.3","keywords":["base64","mime"],"author":{"name":"Andris Reinman"},"license":"MIT","_id":"libbase64@1.3.3","maintainers":[{"name":"andris","email":"andris@kreata.ee"}],"homepage":"https://github.com/nodemailer/libbase64","bugs":{"url":"https://github.com/nodemailer/libbase64/issues"},"dist":{"shasum":"2ebcea700d03a94e73afd20f1e1e240f31afa0b4","tarball":"http://registry-npm.ywwl.com/libbase64/download/libbase64-1.3.3.tgz","fileCount":13,"integrity":"sha512-6n4p3TUeQPimN4ANBTYQ5P4IpFx8p6cdanknnOBfw05XGtaG/k1LAtTSu79w7S07D1esy4qUfM8G4qvQncDWcw==","signatures":[{"sig":"MEQCIFfPabVd4JqIzwKZ5fLKsCuX6zf1gIO4u14dUzEUweSFAiByArNnq4DgqaA18PQuV9mIB4Bh/mftXnxfNrimPMnJuw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIF7c9zs3HYGQYSpePlTjXX1tPbppgUsYj6Hbc0/cc9W6AiEAimtjTm9ug++Gug6zlDmVE3RYqxHzZyr5m0eB0n4Gc48=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/libbase64@1.3.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":28701,"size":10371,"noattachment":false,"key":"/libbase64/-/libbase64-1.3.3.tgz"},"main":"lib/libbase64.js","gitHead":"bd447086192dd41b09615e96ccb584304faeb1ca","scripts":{"test":"grunt","update":"rm -rf node_modules package-lock.json && ncu -u && npm install"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"0e477012-9640-49b3-a376-514ccf239a4a"}},"repository":{"url":"git://github.com/nodemailer/libbase64.git","type":"git"},"_npmVersion":"11.19.0","description":"Encode and decode base64 encoded strings","directories":{},"_nodeVersion":"24.21.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"chai":"4.4.1","grunt":"1.6.3","mocha":"10.3.0","grunt-cli":"1.5.0","grunt-eslint":"24.3.0","grunt-mocha-test":"0.13.3","eslint-config-prettier":"10.1.8","eslint-config-nodemailer":"1.2.0"},"_npmOperationalInternal":{"tmp":"tmp/libbase64_1.3.3_1791956562693_0.1286150536731534","host":"s3://npm-registry-packages-npm-production"},"readme":"# libbase64\n\nEncode and decode base64 strings. Written in TypeScript, published with both ES module and CommonJS builds and type declarations. Requires Node.js 20 or newer.\n\n## Usage\n\nInstall with npm\n\n    npm install libbase64\n\nRequire in your script\n\n```javascript\nconst libbase64 = require('libbase64');\n```\n\nor import it as an ES module\n\n```javascript\nimport libbase64 from 'libbase64';\n// or\nimport { encode, decode, wrap, Encoder, Decoder } from 'libbase64';\n```\n\n### Encode values\n\nEncode Buffer objects or unicode strings with\n\n    libbase64.encode(val) → String\n\nWhere\n\n- **val** is a Buffer, an Uint8Array or an unicode string\n\n**Example**\n\n```javascript\nlibbase64.encode('jõgeva');\n// asO1Z2V2YQ==\n```\n\n### Decode values\n\nDecode base64 strings to a Buffer with\n\n    libbase64.decode(str) → Buffer\n\nWhere\n\n- **str** is a base64 encoded string. Line breaks and other characters outside of the base64 alphabet are ignored. Input made of several separately padded segments (eg. every line padded on its own) is decoded segment by segment\n\n**Example**\n\n```javascript\nlibbase64.decode('asO1Z2V2YQ==').toString();\n// jõgeva\n```\n\n### Wrap encoded values\n\nTo enforce soft line breaks on lines longer than selected amount of characters, use `wrap`\n\n    libbase64.wrap(str[, lineLength]) → String\n\nWhere\n\n- **str** is a base64 encoded string\n- **lineLength** (defaults to 76) is the maximum allowed line length\n\n**Example**\n\n```javascript\nlibbase64.wrap('asO1Z2V2asO1Z2V2asO1Z2V2YQ==', 10);\n// asO1Z2V2as\\r\\n\n// O1Z2V2asO1\\r\\n\n// Z2V2YQ==\n```\n\n### Transform Streams\n\n`libbase64` makes it possible to encode and decode streams with `libbase64.Encoder` and `libbase64.Decoder` constructors.\n\n### Encoder Stream\n\nCreate new Encoder Stream with\n\n    const encoder = new libbase64.Encoder([options])\n\nWhere\n\n- **options** is the optional stream options object\n- **options.lineLength** (Number) if you want to use any other line length than the default 76\n  characters (or set to `false` to turn the soft wrapping off completely)\n- **options.skipStartBytes** (Number) Optional. How many bytes to skip from output (default to 0)\n- **options.limitOutputBytes** (Number) Optional. How many bytes to return (defaults to all bytes). The misspelled `limitOutbutBytes` that earlier versions documented is still accepted\n- **options.startPadding** (String) Optional. Fills first line with provided padding string. Usually goes together with skipStartBytes to get line folding correct.\n\nThe output is the same as `libbase64.wrap(libbase64.encode(input), lineLength)`, no matter how the input is split into chunks.\n\n**Example**\n\nThe following example script reads in a file, encodes it to base64 and saves the output to a file.\n\n```javascript\nconst libbase64 = require('libbase64');\nconst fs = require('fs');\nconst source = fs.createReadStream('source.txt');\nconst encoded = fs.createWriteStream('encoded.txt');\nconst encoder = new libbase64.Encoder();\n\nsource.pipe(encoder).pipe(encoded);\n```\n\n### Decoder Stream\n\nCreate new Decoder Stream with\n\n    const decoder = new libbase64.Decoder([options])\n\nWhere\n\n- **options** is the optional stream options object\n\n**Example**\n\nThe following example script reads in a file in base64 encoding, decodes it and saves the output to a file.\n\n```javascript\nconst libbase64 = require('libbase64');\nconst fs = require('fs');\nconst encoded = fs.createReadStream('encoded.txt');\nconst dest = fs.createWriteStream('dest.txt');\nconst decoder = new libbase64.Decoder();\n\nencoded.pipe(decoder).pipe(dest);\n```\n\n## License\n\n**MIT**\n","publish_time":1791956562764,"_cnpm_publish_time":1791956562764,"dist-tags":{"latest":"1.4.1"}}