Skip to content

Instantly share code, notes, and snippets.

@martintajur
martintajur / simple-lockfile-for-nodejs.js
Created January 19, 2012 14:36
Simple lock-file mechanism for nodeJS
var fs = require('fs');
var path = require('path');
if (typeof exports === 'undefined') var exports = {};
exports.exists = function(filename) {
try {
return (fs.lstatSync(filename) ? true : false);
}
catch (err) {