UNPKG

yunlongzha_try_nodejs

Version:

try it

1 lines 3.94 kB
{"_id":"libbase64","_rev":"2-9d9a6d0d0aae4f0d47bbae13d66965ea","name":"libbase64","description":"Encode and decode base64 encoded strings","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"libbase64","version":"0.1.0","description":"Encode and decode base64 encoded strings","main":"lib/libbase64.js","scripts":{"test":"grunt"},"repository":{"type":"git","url":"git://github.com/andris9/libbase64.git"},"keywords":["base64","mime"],"author":{"name":"Andris Reinman"},"license":"MIT","bugs":{"url":"https://github.com/andris9/libbase64/issues"},"homepage":"https://github.com/andris9/libbase64","devDependencies":{"chai":"~1.8.1","grunt":"~0.4.1","grunt-contrib-jshint":"~0.8.0","grunt-mocha-test":"~0.10.0"},"_id":"libbase64@0.1.0","dist":{"shasum":"62351a839563ac5ff5bd26f12f60e9830bb751e6","tarball":"http://registry.npmjs.org/libbase64/-/libbase64-0.1.0.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"andris","email":"andris@node.ee"},"maintainers":[{"name":"andris","email":"andris@node.ee"}],"directories":{}}},"readme":"# libbase64\n\nEncode and decode base64 strings.\n\n## Usage\n\nInstall with npm\n\n npm install libbase64\n\nRequire in your script\n\n```javascript\nvar libbase64 = require('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 or an unicode string\n\n**Example**\n\n```javascript\nlibbase64.encode('jõgeva');\n// asO1Z2V2YQ==\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 var encoder = new libbase64.Encoder([options])\n\nWhere\n\n * **options** is the optional stream options object with an additional option `lineLength` if you want to use any other line length than the default 76 characters (or set to `false` to turn the soft wrapping off completely)\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\nvar libbase64 = require('libbase64');\nvar fs = require('fs');\nvar source = fs.createReadStream('source.txt');\nvar encoded = fs.createReadStream('encoded.txt');\nvar encoder = new libbase64.Encoder();\n\nsource.pipe(encoder).pipe(encoded);\n```\n\n### Decoder Stream\n\nCreate new Decoder Stream with\n\n var 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\nvar libbase64 = require('libbase64');\nvar fs = require('fs');\nvar encoded = fs.createReadStream('encoded.txt');\nvar dest = fs.createReadStream('dest.txt');\nvar decoder = new libbase64.Decoder();\n\nencoded.pipe(decoder).pipe(dest);\n```\n\n## License\n\n**MIT**","maintainers":[{"name":"andris","email":"andris@node.ee"}],"time":{"modified":"2014-06-18T13:27:18.378Z","created":"2014-06-18T13:27:18.378Z","0.1.0":"2014-06-18T13:27:18.378Z"},"homepage":"https://github.com/andris9/libbase64","keywords":["base64","mime"],"repository":{"type":"git","url":"git://github.com/andris9/libbase64.git"},"author":{"name":"Andris Reinman"},"bugs":{"url":"https://github.com/andris9/libbase64/issues"},"license":"MIT","readmeFilename":"README.md","_attachments":{},"_etag":"\"9UYI9HMRQOEDM760U86UPEF6M\""}