npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nondest

v0.0.1

Published

A tempfile creator for 'non-destructive' file operations in node.js

Downloads

12

Readme

nondest

Super simple, dependency-free temporary file creator for 'non-destructive' operations in your node.js app.

About

nondest is for times when you need to be able to safely edit (or hack away at) the contents of a file from within a node application for some purpose, without ever wanting to actually alter the data on disk.

I've experienced file corruption during long running operations with open file streams, so with this I'm safely working on copied data.

Installation

npm install nondest

Usage

There's not much to it. Call create with the path and options to use, and work with the files after the available event fires.

NOTE: a call to remove() is required to delete the temp directory.

Setup

    var nondest = require('nondest');

Create the temporary copy & wait for it's availability:

nondest.create('../filepath', {
    }).on('available', function(tmppath) {
    
		// hack away on files in tmppath	
	
	}).on('error', function(err){
		// do something with err
	});

Cleanup

If you want to keep $TMPDIR tidy:

process.on('exit', function(){
	nondest.remove(function(err){
		// handle error during rmdir
    });
});

Events

The following events are emitted:

  • available: files have finished copying and are ready at the returned tmppath path
  • error: domain error occurred within the module

Options

The following options are available:

  • id: the temp directory name, defaults to util.format('_nondest_%s_%s', process.pid, new Date().getTime()), or you can pass in something super unique
  • limit: the number of simultaneous "workers" allowed during copy operation - defaults to 12
  • filter: a RegExp or function() to filter what gets copied
  • temppath: provide a path to override the use of $TMPDIR if you wish

Info

A couple of notes:

All functionality in the module is wrapped in a domain so any errors encountered should only bubble up to nondest's domain.on('error') which then will fire it's error event for you to handle.

I have not yet tested this on every platform so please open an issue if you find any platform or other bugs. And be sure to submit a pull request if you tweak, correct, or otherwise improve the code ; )