iolib
v1.0.9
Published
Code for handling line-by-line text I/O, block oriented binary I/O, and filesystem operations.
Downloads
24
Maintainers
Readme
File system basics
I/O Lib
Text and binary file essential I/O
Motivation
Reading and writing text files using line-oriented functions is a common need. Handling block transfers of binary data is necessary for packed data formats.
Performing basic filesystem operations complements these two.
Features
The TextReader
class has a UTF-8 aware getline
method for parsing a text file
one line at a time.
The TextWriter
class has putline
and puts
methods to serialize to a text file.
The lower level BinaryReader
reads a block of 8192 bytes, advancing the buffer
pointer with each read.
The BinaryWriter
class has methods for writing Strings, Buffers, 4-bytes,
2-bytes, and 1-byte .
The Pfile
class has methods for checking if a file exists; if it's a directory
or a symlink; if it's readable, writable, executable; and for assembling and
accessing parts of a file's path, basename, and extension.
Installation
The iolib library may be installed directly from github or via NPM.
[user@host]# npm install iolib
Sample usage of the libary in a node.js project:
import {TextReader} from 'iolib';
import {TextWriter} from 'iolib';
import {BinaryReader} from 'iolib';
import {BinaryWriter} from 'iolib';
import {Pfile} from 'iolib';
Metadata
Dependencies
This library depends on softlib , which should be installed side-by-side.
Module exports
Suitability
Availability
License
The iolib library is licensed under the MIT License.