Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Node.js extensions
JavaScript

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
CHANGES
Makefile
README.md
package.json

README.md

node-ext - Node.js extensions

Functions that complement Node.js API.
It's work in progress, new methods are added when needed.

Installation

$ npm install next

Usage

var nfs   = require('next/lib/fs')
  , npath = require('next/lib/path');

nfs.fileExists(filepath, callback);
dirpath = npath.trim(dirpath);

Alternatively you can import each function individually

var fileExists = require('next/lib/fs/file-exists')
  , pathTrim   = require('next/lib/path/trim');

fileExists(filepath, callback);
dirpath = pathTrim(dirpath);

Extensions

Each extension is documented at begin of its source file.

  • findPackageRoot(path)
  • getRequire(path)
  • isModuleNotFoundError(error, path)
  • requireInContext(path, context)
  • requireSilent(path)

child_process

  • child_process.pipe

fs

  • fs.copy
  • fs.copySync
  • fs.dirExists
  • fs.fileExists
  • fs.readdirFilesDeep

path

  • path.relative
  • path.trim
Something went wrong with that request. Please try again.