Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

temporary

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

temporary - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

.npmignore

16

lib/base.js
/**
* Temporary - The lord of tmp.
*
*
* Author: Veselin Todorov <hi@vesln.com>

@@ -18,3 +18,3 @@ * Licensed under the MIT License.

* Base constructor.
*
*
* @param {String|null} name

@@ -28,3 +28,3 @@ */

* Initializes the class.
*
*
* @param {String|null} name

@@ -41,3 +41,3 @@ */

* append `this.path` as first element.
*
*
* @returns {Array}

@@ -53,3 +53,3 @@ */

* Renames the dir/file.
*
*
* @param {String} name

@@ -62,3 +62,3 @@ * @param {Function} cb Callback.

var tmp = path.normalize(path.dirname(self.path) + '/' + name);
fs.rename(this.path, tmp, function(err) {

@@ -72,3 +72,3 @@ self.path = tmp;

* Renames the dir/file sync.
*
*
* @param {String} name

@@ -86,2 +86,2 @@ */

*/
module.exports = Base;
module.exports = Base;
/**
* Temporary - The lord of tmp.
*
*
* Author: Veselin Todorov <hi@vesln.com>

@@ -19,3 +19,3 @@ * Licensed under the MIT License.

* Dir constructor.
*
*
* @param {String|null} name

@@ -34,3 +34,3 @@ */

* Creates new file.
*
*
* @param {String} dirname

@@ -59,2 +59,2 @@ */

*/
module.exports = Dir;
module.exports = Dir;
/**
* Temporary - The lord of tmp.
*
*
* Author: Veselin Todorov <hi@vesln.com>

@@ -19,3 +19,3 @@ * Licensed under the MIT License.

* File constructor.
*
*
* @param {String|null} name

@@ -34,3 +34,3 @@ */

* Creates new file.
*
*
* @param {String} filename

@@ -115,2 +115,2 @@ */

*/
module.exports = File;
module.exports = File;
/**
* Temporary - The lord of tmp.
*
*
* Author: Veselin Todorov <hi@vesln.com>

@@ -11,8 +11,10 @@ * Licensed under the MIT License.

*/
var fs = require('fs');
var path = require('path');
var detector = require('./detector');
var existsSync = fs.existsSync || path.existsSync;
/**
* Generator namespace.
*
*
* @type {Object}

@@ -24,3 +26,3 @@ */

* Generates random name.
*
*
* @returns {String}

@@ -33,4 +35,4 @@ */

id = Date.now() + Math.random();
} while(path.existsSync(tmp + '/' + id));
} while(existsSync(tmp + '/' + id));
return id + '';

@@ -41,3 +43,3 @@ };

* Buld a full name. (tmp dir + name).
*
*
* @param {String} name

@@ -50,2 +52,2 @@ * @returns {String}

return filename + this.name();
};
};
{
"name": "temporary"
, "version": "0.0.2"
, "version": "0.0.3"
, "description": "The lord of tmp."

@@ -8,6 +8,6 @@ , "keywords": ["tmp", "temp", "tempfile", "tempdirectory"]

, "dependencies": {
"package": "1.0.0"
"package": ">= 1.0.0 < 1.2.0"
}
, "devDependencies": {
"mocha": "0.3.3"
"mocha": "1.2.x"
, "should": "0.3.2"

@@ -25,3 +25,3 @@ , "sinon": "1.2.0"

, "main": "index"
, "engines": { "node": ">= 0.6.0 < 0.7.0" }
}
, "engines": { "node": ">= 0.6.0" }
}

@@ -21,4 +21,4 @@ [![Build Status](https://secure.travis-ci.org/vesln/temporary.png)](http://travis-ci.org/vesln/temporary)

var Tempfile = require('tepmorary/file');
var Tempdir = require('tepmorary/dir');
var Tempfile = require('temporary/file');
var Tempdir = require('temporary/dir');
var file = new Tempfile;

@@ -25,0 +25,0 @@ var dir = new Tempdir;

/**
* Temporary - The lord of tmp.
*
*
* Author: Veselin Todorov <hi@vesln.com>
* Licensed under the MIT License.
*/
/**

@@ -13,4 +13,7 @@ * Dependencies.

var fs = require('fs');
var existsSync = fs.existsSync || path.existsSync;
var Base = require('../lib/base');
var generator = require('../lib/generator');
var should = require('chai').should();

@@ -25,5 +28,5 @@ Base.prototype.create = function() {};

fs.mkdirSync(path.normalize(tmp.path), 0777);
path.existsSync(tmp.path).should.be.ok;
existsSync(tmp.path).should.be.ok;
tmp.rename('foo', function(err) {
path.existsSync(tmp.path).should.be.ok;
existsSync(tmp.path).should.be.ok;
done();

@@ -33,3 +36,3 @@ });

});
describe('renameSync', function() {

@@ -41,9 +44,9 @@ it('should rename the directory', function() {

var oldPath = tmp.path;
path.existsSync(tmp.path).should.be.ok;
existsSync(tmp.path).should.be.ok;
tmp.renameSync('foo3');
path.existsSync(tmp.path).should.be.ok;
existsSync(tmp.path).should.be.ok;
path.should.not.eql(oldPath);
});
});
describe('prepareArgs', function() {

@@ -58,2 +61,2 @@ it('should convert object to array and append path as first element', function() {

});
});
});
/**
* Temporary - The lord of tmp.
*
*
* Author: Veselin Todorov <hi@vesln.com>
* Licensed under the MIT License.
*/
/**

@@ -12,2 +12,3 @@ * Dependencies.

var detector = require('../lib/detector');
var should = require('chai').should();

@@ -24,2 +25,2 @@ describe('detector', function() {

});
});
});
/**
* Temporary - The lord of tmp.
*
*
* Author: Veselin Todorov <hi@vesln.com>
* Licensed under the MIT License.
*/
/**
* Dependencies.
*/
var fs = require('fs');
var path = require('path');
var fs = require('fs');
var existsSync = fs.existsSync || path.existsSync;
var Tempdir = require('../lib/dir');
var sinon = require('sinon');
var should = require('chai').should();

@@ -19,5 +22,5 @@ describe('Tempdir', function() {

var tmp = new Tempdir('foo');
path.existsSync(tmp.path).should.be.ok;
existsSync(tmp.path).should.be.ok;
});
describe('rmdir', function() {

@@ -32,3 +35,3 @@ it('should remove the directory', function() {

});
describe('rmdirSync', function() {

@@ -43,2 +46,2 @@ it('should remove the directory', function() {

});
});
});
/**
* Temporary - The lord of tmp.
*
*
* Author: Veselin Todorov <hi@vesln.com>
* Licensed under the MIT License.
*/
/**

@@ -13,4 +13,7 @@ * Dependencies.

var fs = require('fs');
var existsSync = fs.existsSync || path.existsSync;
var Tempfile = require('../lib/file');
var sinon = require('sinon');
var should = require('chai').should();

@@ -20,5 +23,5 @@ describe('Tempfile', function() {

var tmp = new Tempfile('foo');
path.existsSync(tmp.path).should.be.ok;
existsSync(tmp.path).should.be.ok;
});
describe('readFile', function() {

@@ -33,3 +36,3 @@ it('should call fs.readfile', function() {

});
describe('readFileSync', function() {

@@ -44,3 +47,3 @@ it('should call fs.readfileSync', function() {

});
describe('writeFile', function() {

@@ -65,3 +68,3 @@ it('should call fs.readfile', function() {

});
describe('open', function() {

@@ -86,3 +89,3 @@ it('should call fs.open', function() {

});
describe('close', function() {

@@ -109,3 +112,3 @@ it('should call fs.close', function() {

});
describe('unlink', function() {

@@ -130,2 +133,2 @@ it('should call fs.unlink', function() {

});
});
});
/**
* Temporary - The lord of tmp.
*
*
* Author: Veselin Todorov <hi@vesln.com>
* Licensed under the MIT License.
*/
/**

@@ -13,2 +13,3 @@ * Dependencies.

var detector = require('../lib/detector');
var should = require('chai').should();

@@ -21,3 +22,3 @@ describe('generator', function() {

});
describe('build', function() {

@@ -30,2 +31,2 @@ it('should build full names', function() {

});
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc