Package Exports
- uue
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (uue) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
The UUE module is able to perform uuencoding of a file (or Node.js Buffer) to a text message.
The module is named after a common .UUE suffix for Fidonet echomail areas spreading uuencoded files (sometimes the results of such encoding are also known as “UUE codes”).
The module is written in JavaScript and requires Node.js to run.
Installing the UUE module
Latest packaged version:
npm install uueLatest githubbed version:
npm install https://github.com/Mithgol/node-uue/tarball/master
The npm package does not contain the tests, they're published on GitHub only.
You may visit https://github.com/Mithgol/node-uue#readme occasionally to read the latest README because the package's version is not planned to grow after changes when they happen in README only. (And npm publish --force is forbidden nowadays.)
Using the UUE module
When you require() the installed module, you get an object that has the following method:
encode(encodeSource, encodeOptions)
Returns a string of UUE codes that represent the given source.
If
encodeSourceis a string, it is interpreted as a path of some file, and that file is uuencoded.If
encodeSourceis a Node.js Buffer, the contents of that buffer become uuencoded.
The optional encodeOptions parameter is an object with the following optional properties:
mode— read/write/execute permissions for the file. If this property is omitted, three last octal digits of themodeproperty of the given file'sfs.Statsobject are used (or'644'if a Buffer is given inencodeSourceinstead of a file). Themodeproperty may be given as a string (of octal digits) or as a number (for example,'666'and438are equivalent).filename— a file's name to be given in UUE codes. (For example, ifencodeOptionsis{mode:'664', filename:'filename.ext'}, then the first line of UUE codes isbegin 664 filename.ext.) If this property is omitted, thenpath.basename(encodeSource)is used (or'buffer.bin'if a Buffer is given inencodeSourceinstead of a file).eol— end-of-line character(s). If this property is omitted,\n(\x0A) is used (as in Web or UN*X applications). You may want to setencodeOptions.eolequal toos.EOLon other systems. The value ofencodeOptions.eolis used only as a separator between lines of UUE codes, but neither in the beginning nor at the end of the returned string.
Locking files
The module does not lock any files and does not create any “lock files” (flag files, semaphore files). The module's caller should control the access to the file being encoded.
Testing the UUE module
The tests are not included in the npm package of the module (to keep it small). Use the version from GitHub.
It is necessary to install Mocha and JSHint for testing.
You may install Mocha globally (
npm install mocha -g) or locally (npm install mochain the directory of the UUE module).You may install JSHint globally (
npm install jshint -g) or locally (npm install jshintin the directory of the UUE module).
After that you may run npm test (in the directory of the UUE module).
License
MIT license (see the LICENSE file).
