Noodles, Poodles and More!

    @util.js/node-files

    0.41.1 • Public • Published

    @util.js/node-files

    JavaScript Node.js utility methods for files

    NPM Status Travis CI Build Status

    @util.js/node-files is part of Util.js.

    This class contains all the methods of fs and path in addition to:

    • cpr
    • diff
    • filesWithExtension
    • filesWithExtensionSync
    • isDirectory
    • isDirectorySync
    • isFile
    • isFileSync
    • mkdirp
    • mkdirpSync
    • readFiles
    • readLastLines
    • rmrf
    • rmrfSync
    • sanitizeFilename
    • touch

    Files

    files.readLastLines(path, maxLineCount, [encoding], [callback]) ⇒ Promise | undefined

    Reads in the last n lines of a file.

    This function just delegates to https://github.com/alexbbt/read-last-lines .

    Kind: instance method of Files
    Returns: Promise | undefined - a Promise that resolves with the lines (as a String or a Buffer) or rejects with an error or undefined if a callback is specified

    Param Type Default Description
    path Buffer | String | URL absolute or relative path to a file; URLs must use the file:// scheme
    maxLineCount Number max number of lines to read
    [encoding] String "utf8" specifies the character encoding to use or "buffer"
    [callback] function an optional callback

    Install

    npm i @util.js/node-files

    DownloadsWeekly Downloads

    2

    Version

    0.41.1

    License

    MIT

    Unpacked Size

    55.3 kB

    Total Files

    7

    Last publish

    Collaborators

    • creemama