posixy

some POSIX utilities that behave correctly(tm)


Keywords
posix, node, link, mktemp, mktmp
License
BSD-1-Clause
Install
npm install posixy@0.0.4

Documentation

Posixy Extensions for Node.js

Build Status

This package will provide you with some utilities that you might already know from Node.js, but which behave a bit more reliable.

Installation

npm install posixy

API reference

posixy.link(linkTarget, linkLocation, callback)

  • linkTarget: the new link should point to that file
  • linkLocation: the location of the new link to create
  • callback: a function which will be called after creating the link. The function will be invoked with one argument: null or an error.

Create a hard link at linkLocation which points to the file at linkTarget. Unlike fs.link(), posixy.link() will fail for an already existing linkLocation.

posixy.mktemp(callback)

  • callback: a function which will be invoked after generating a temporary file name. The function will be invoked with two arguments: Beginning with null or an error followed by an object (like '{path: "…"}') or null (in case of an error).

Create the name for a future temporary file/folder.