...
 
Commits (9)
engines:
eslint:
enabled: true
channel: "eslint-3"
exclude_paths:
- "docs/"
module.exports = {
"env": {
"node": true
},
"extends": "eslint:recommended",
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
"env": {
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
};
## Operating System
- [ ] Linux
- [ ] Windows 7
- [ ] Windows 10
- [ ] MacOS
- other:
## NodeJS Version
- [ ] 0.x
- [ ] 4.x
- [ ] 6.x
- [ ] 7.x
- other:
## Tmp Version
TBD:Enter tmp version here
## Expected Behavior
TBD:What have you expected tmp to do?
## Experienced Behavior
TBD:What did actually happen?
node_modules/
.idea/
.*.swp
{
"opts": {
"destination": "docs",
"readme": "README.md"
},
"source": {
"include": ["lib"],
"includePattern": ".+\\.js$",
"excludePattern": ""
},
"plugins": [],
"templates": {
"default": {
"outputSourceFiles": true
}
}
}
......@@ -23,6 +23,7 @@ node_js:
- "5.11"
- "6.0"
- "6.1"
- "7"
- "node"
sudo: false
cache:
......
......@@ -5,6 +5,8 @@ A simple temporary file and directory creator for [node.js.][1]
[![Build Status](https://travis-ci.org/raszi/node-tmp.svg?branch=master)](https://travis-ci.org/raszi/node-tmp)
[![Dependencies](https://david-dm.org/raszi/node-tmp.svg)](https://david-dm.org/raszi/node-tmp)
[![npm version](https://badge.fury.io/js/tmp.svg)](https://badge.fury.io/js/tmp)
[![API documented](https://img.shields.io/badge/API-documented-brightgreen.svg)](https://raszi.github.io/node-tmp/)
[![Known Vulnerabilities](https://snyk.io/test/npm/tmp/badge.svg)](https://snyk.io/test/npm/tmp)
## About
......@@ -12,7 +14,8 @@ This is a [widely used library][2] to create temporary files and directories
in a [node.js][1] environment.
Tmp offers both an asynchronous and a synchronous API. For all API calls, all
the parameters are optional.
the parameters are optional. There also exists a promisified version of the
API, see (5) under references below.
Tmp uses crypto for determining random file names, or, when using templates,
a six letter random identifier. And just in case that you do not have that much
......@@ -29,6 +32,8 @@ npm install tmp
## Usage
Please also check [API docs][4].
### Asynchronous file creation
Simple temporary file creation, the file will be closed and unlinked on process exit.
......@@ -39,8 +44,8 @@ var tmp = require('tmp');
tmp.file(function _tempFileCreated(err, path, fd, cleanupCallback) {
if (err) throw err;
console.log("File: ", path);
console.log("Filedescriptor: ", fd);
console.log('File: ', path);
console.log('Filedescriptor: ', fd);
// If we don't need the file anymore we could manually call the cleanupCallback
// But that is not necessary if we didn't pass the keep option because the library
......@@ -57,8 +62,8 @@ A synchronous version of the above.
var tmp = require('tmp');
var tmpobj = tmp.fileSync();
console.log("File: ", tmpobj.name);
console.log("Filedescriptor: ", tmpobj.fd);
console.log('File: ', tmpobj.name);
console.log('Filedescriptor: ', tmpobj.fd);
// If we don't need the file anymore we could manually call the removeCallback
// But that is not necessary if we didn't pass the keep option because the library
......@@ -82,7 +87,7 @@ var tmp = require('tmp');
tmp.dir(function _tempDirCreated(err, path, cleanupCallback) {
if (err) throw err;
console.log("Dir: ", path);
console.log('Dir: ', path);
// Manual cleanup
cleanupCallback();
......@@ -100,7 +105,7 @@ A synchronous version of the above.
var tmp = require('tmp');
var tmpobj = tmp.dirSync();
console.log("Dir: ", tmpobj.name);
console.log('Dir: ', tmpobj.name);
// Manual cleanup
tmpobj.removeCallback();
```
......@@ -120,7 +125,7 @@ var tmp = require('tmp');
tmp.tmpName(function _tempNameGenerated(err, path) {
if (err) throw err;
console.log("Created temporary filename: ", path);
console.log('Created temporary filename: ', path);
});
```
......@@ -132,7 +137,7 @@ A synchronous version of the above.
var tmp = require('tmp');
var name = tmp.tmpNameSync();
console.log("Created temporary filename: ", name);
console.log('Created temporary filename: ', name);
```
## Advanced usage
......@@ -147,8 +152,8 @@ var tmp = require('tmp');
tmp.file({ mode: 0644, prefix: 'prefix-', postfix: '.txt' }, function _tempFileCreated(err, path, fd) {
if (err) throw err;
console.log("File: ", path);
console.log("Filedescriptor: ", fd);
console.log('File: ', path);
console.log('Filedescriptor: ', fd);
});
```
......@@ -160,8 +165,8 @@ A synchronous version of the above.
var tmp = require('tmp');
var tmpobj = tmp.fileSync({ mode: 0644, prefix: 'prefix-', postfix: '.txt' });
console.log("File: ", tmpobj.name);
console.log("Filedescriptor: ", tmpobj.fd);
console.log('File: ', tmpobj.name);
console.log('Filedescriptor: ', tmpobj.fd);
```
### Controlling the Descriptor
......@@ -213,7 +218,7 @@ var tmp = require('tmp');
tmp.dir({ mode: 0750, prefix: 'myTmpDir_' }, function _tempDirCreated(err, path) {
if (err) throw err;
console.log("Dir: ", path);
console.log('Dir: ', path);
});
```
......@@ -225,7 +230,7 @@ Again, a synchronous version of the above.
var tmp = require('tmp');
var tmpobj = tmp.dirSync({ mode: 0750, prefix: 'myTmpDir_' });
console.log("Dir: ", tmpobj.name);
console.log('Dir: ', tmpobj.name);
```
### mkstemp like, asynchronously
......@@ -238,7 +243,7 @@ var tmp = require('tmp');
tmp.dir({ template: '/tmp/tmp-XXXXXX' }, function _tempDirCreated(err, path) {
if (err) throw err;
console.log("Dir: ", path);
console.log('Dir: ', path);
});
```
......@@ -250,7 +255,7 @@ This will behave similarly to the asynchronous version.
var tmp = require('tmp');
var tmpobj = tmp.dirSync({ template: '/tmp/tmp-XXXXXX' });
console.log("Dir: ", tmpobj.name);
console.log('Dir: ', tmpobj.name);
```
### Asynchronous filename generation
......@@ -263,7 +268,7 @@ var tmp = require('tmp');
tmp.tmpName({ template: '/tmp/tmp-XXXXXX' }, function _tempNameGenerated(err, path) {
if (err) throw err;
console.log("Created temporary filename: ", path);
console.log('Created temporary filename: ', path);
});
```
......@@ -274,7 +279,7 @@ The `tmpNameSync()` function works similarly to `tmpName()`.
```javascript
var tmp = require('tmp');
var tmpname = tmp.tmpNameSync({ template: '/tmp/tmp-XXXXXX' });
console.log("Created temporary filename: ", tmpname);
console.log('Created temporary filename: ', tmpname);
```
## Graceful cleanup
......@@ -305,3 +310,5 @@ All options are optional :)
[1]: http://nodejs.org/
[2]: https://www.npmjs.com/browse/depended/tmp
[3]: http://www.kernel.org/doc/man-pages/online/pages/man3/mkstemp.3.html
[4]: https://raszi.github.io/node-tmp/
[5]: https://github.com/benjamingr/tmp-promise
# https://www.appveyor.com/docs/lang/nodejs-iojs/
environment:
matrix:
- nodejs_version: "4"
- nodejs_version: "5"
- nodejs_version: "6"
- nodejs_version: "7"
install:
- ps: Install-Product node $env:nodejs_version
- npm install
test_script:
- node --version
- npm --version
- npm test
build: off
node-tmp (0.0.33-1) unstable; urgency=medium
* New upstream version 0.0.33
* Bump debhelper compatibility level to 11
* Bump Standards-Version to 4.3.0 (no changes needed)
* Add myself as an uploader
* Update d/control
* Update d/copyright
* Switch test to pkg-js-tools
* Hide false positive lintian errors
-- Utkarsh Gupta <guptautkarsh2102@gmail.com> Sun, 03 Mar 2019 14:03:41 +0530
node-tmp (0.0.31-1) unstable; urgency=medium
* Move node-tmp from experimental to unstable, Stretch freeze is over
......
Source: node-tmp
Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>
Uploaders: Ross Gammon <rosco2@ubuntu.com>
Section: javascript
Priority: optional
Build-Depends: debhelper (>= 9),
dh-buildinfo,
Maintainer: Debian Javascript Maintainers <pkg-javascript-devel@lists.alioth.debian.org>
Uploaders: Ross Gammon <rosco2@ubuntu.com>,
Utkarsh Gupta <guptautkarsh2102@gmail.com>
Testsuite: autopkgtest-pkg-nodejs
Build-Depends: debhelper (>= 11~),
nodejs,
node-vows,
node-os-tmpdir
Standards-Version: 4.0.0
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-javascript/node-tmp.git
Vcs-Git: https://anonscm.debian.org/git/pkg-javascript/node-tmp.git
Homepage: http://github.com/raszi/node-tmp
node-os-tmpdir,
pkg-js-tools
Standards-Version: 4.3.0
Homepage: https://github.com/raszi/node-tmp
Vcs-Git: https://salsa.debian.org/js-team/node-tmp.git
Vcs-Browser: https://salsa.debian.org/js-team/node-tmp
Package: node-tmp
Architecture: all
......@@ -35,4 +37,3 @@ Description: Temporary file and directory creator for Node.js
not, and the destination directory can also be set.
.
Node.js is an event-based server-side JavaScript engine.
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Tmp
Upstream-Contact: KARASZI István <github@spam.raszi.hu> (http://raszi.hu/)
Source: http://github.com/raszi/node-tmp
Upstream-Name: tmp
Upstream-Contact: KARASZI István <github@spam.raszi.hu>
Source: https://github.com/raszi/node-tmp
Files: *
Copyright: 2011-2015, KARASZI István <github@spam.raszi.hu> (http://raszi.hu/)
Copyright: 2014, KARASZI István <github@spam.raszi.hu>
License: Expat
Files: debian/*
......@@ -32,4 +32,3 @@ License: Expat
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
......@@ -5,8 +5,4 @@
#export DH_VERBOSE=1
%:
dh $@
override_dh_auto_test:
vows test/*-test.js
dh $@ --with nodejs
# False-positive: array of data
source-contains-prebuilt-javascript-object docs/scripts/prettify/lang-css.js line length is 390 characters (>256)
source-is-missing docs/scripts/prettify/lang-css.js line length is 390 characters (>256)
insane-line-length-in-source-file docs/scripts/prettify/prettify.js line length is 563 characters (>512)
source-contains-prebuilt-javascript-object docs/scripts/prettify/prettify.js line length is 563 characters (>512)
source-is-missing docs/scripts/prettify/prettify.js line length is 563 characters (>512)
\ No newline at end of file
Tests: require
Depends: node-tmp
vows test/*-test.js
#!/bin/sh
set -e
nodejs -e "require('tmp');"
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
/*global document */
(function() {
var source = document.getElementsByClassName('prettyprint source linenums');
var i = 0;
var lineNumber = 0;
var lineId;
var lines;
var totalLines;
var anchorHash;
if (source && source[0]) {
anchorHash = document.location.hash.substring(1);
lines = source[0].getElementsByTagName('li');
totalLines = lines.length;
for (; i < totalLines; i++) {
lineNumber++;
lineId = 'line' + lineNumber;
lines[i].id = lineId;
if (lineId === anchorHash) {
lines[i].className += ' selected';
}
}
}
})();
This diff is collapsed.
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com",
/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);
This diff is collapsed.
@font-face {
font-family: 'Open Sans';
font-weight: normal;
font-style: normal;
src: url('../fonts/OpenSans-Regular-webfont.eot');
src:
local('Open Sans'),
local('OpenSans'),
url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/OpenSans-Regular-webfont.woff') format('woff'),
url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg');
}
@font-face {
font-family: 'Open Sans Light';
font-weight: normal;
font-style: normal;
src: url('../fonts/OpenSans-Light-webfont.eot');
src:
local('Open Sans Light'),
local('OpenSans Light'),
url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/OpenSans-Light-webfont.woff') format('woff'),
url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg');
}
html
{
overflow: auto;
background-color: #fff;
font-size: 14px;
}
body
{
font-family: 'Open Sans', sans-serif;
line-height: 1.5;
color: #4d4e53;
background-color: white;
}
a, a:visited, a:active {
color: #0095dd;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
header
{
display: block;
padding: 0px 4px;
}
tt, code, kbd, samp {
font-family: Consolas, Monaco, 'Andale Mono', monospace;
}
.class-description {
font-size: 130%;
line-height: 140%;
margin-bottom: 1em;
margin-top: 1em;
}
.class-description:empty {
margin: 0;
}
#main {
float: left;
width: 70%;
}
article dl {
margin-bottom: 40px;
}
section
{
display: block;
background-color: #fff;
padding: 12px 24px;
border-bottom: 1px solid #ccc;
margin-right: 30px;
}
.variation {
display: none;
}
.signature-attributes {
font-size: 60%;
color: #aaa;
font-style: italic;
font-weight: lighter;
}
nav
{
display: block;
float: right;
margin-top: 28px;
width: 30%;
box-sizing: border-box;
border-left: 1px solid #ccc;
padding-left: 16px;
}
nav ul {
font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
font-size: 100%;
line-height: 17px;
padding: 0;
margin: 0;
list-style-type: none;
}
nav ul a, nav ul a:visited, nav ul a:active {
font-family: Consolas, Monaco, 'Andale Mono', monospace;
line-height: 18px;
color: #4D4E53;
}
nav h3 {
margin-top: 12px;
}
nav li {
margin-top: 6px;
}
footer {
display: block;
padding: 6px;
margin-top: 12px;
font-style: italic;
font-size: 90%;
}
h1, h2, h3, h4 {
font-weight: 200;
margin: 0;
}
h1
{
font-family: 'Open Sans Light', sans-serif;
font-size: 48px;
letter-spacing: -2px;
margin: 12px 24px 20px;
}
h2, h3.subsection-title
{
font-size: 30px;
font-weight: 700;
letter-spacing: -1px;
margin-bottom: 12px;
}
h3
{
font-size: 24px;
letter-spacing: -0.5px;
margin-bottom: 12px;
}
h4
{
font-size: 18px;
letter-spacing: -0.33px;
margin-bottom: 12px;
color: #4d4e53;
}
h5, .container-overview .subsection-title
{
font-size: 120%;
font-weight: bold;
letter-spacing: -0.01em;
margin: 8px 0 3px 0;
}
h6
{
font-size: 100%;
letter-spacing: -0.01em;
margin: 6px 0 3px 0;
font-style: italic;
}
table
{
border-spacing: 0;
border: 0;
border-collapse: collapse;
}
td, th
{
border: 1px solid #ddd;
margin: 0px;
text-align: left;
vertical-align: top;
padding: 4px 6px;
display: table-cell;
}
thead tr
{
background-color: #ddd;
font-weight: bold;
}
th { border-right: 1px solid #aaa; }
tr > th:last-child { border-right: 1px solid #ddd; }
.ancestors { color: #999; }
.ancestors a
{
color: #999 !important;
text-decoration: none;
}
.clear
{
clear: both;
}
.important
{
font-weight: bold;
color: #950B02;
}
.yes-def {
text-indent: -1000px;
}
.type-signature {
color: #aaa;
}
.name, .signature {
font-family: Consolas, Monaco, 'Andale Mono', monospace;
}
.details { margin-top: 14px; border-left: 2px solid #DDD; }
.details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; }
.details dd { margin-left: 70px; }
.details ul { margin: 0; }
.details ul { list-style-type: none; }
.details li { margin-left: 30px; padding-top: 6px; }
.details pre.prettyprint { margin: 0 }
.details .object-value { padding-top: 0; }
.description {
margin-bottom: 1em;
margin-top: 1em;
}
.code-caption
{
font-style: italic;
font-size: 107%;
margin: 0;
}
.prettyprint
{
border: 1px solid #ddd;
width: 80%;
overflow: auto;
}
.prettyprint.source {
width: inherit;
}
.prettyprint code
{
font-size: 100%;
line-height: 18px;
display: block;
padding: 4px 12px;
margin: 0;
background-color: #fff;
color: #4D4E53;
}
.prettyprint code span.line
{
display: inline-block;
}
.prettyprint.linenums
{
padding-left: 70px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.prettyprint.linenums ol
{
padding-left: 0;
}
.prettyprint.linenums li
{
border-left: 3px #ddd solid;
}
.prettyprint.linenums li.selected,
.prettyprint.linenums li.selected *
{
background-color: lightyellow;
}
.prettyprint.linenums li *
{
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.params .name, .props .name, .name code {
color: #4D4E53;
font-family: Consolas, Monaco, 'Andale Mono', monospace;
font-size: 100%;
}
.params td.description > p:first-child,
.props td.description > p:first-child
{
margin-top: 0;
padding-top: 0;
}
.params td.description > p:last-child,
.props td.description > p:last-child
{
margin-bottom: 0;
padding-bottom: 0;
}
.disabled {
color: #454545;
}
/* JSDoc prettify.js theme */
/* plain text */
.pln {
color: #000000;
font-weight: normal;
font-style: normal;
}
/* string content */
.str {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* a keyword */
.kwd {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* a comment */
.com {
font-weight: normal;
font-style: italic;
}
/* a type name */
.typ {
color: #000000;
font-weight: normal;
font-style: normal;
}
/* a literal value */
.lit {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* punctuation */
.pun {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* lisp open bracket */
.opn {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* lisp close bracket */
.clo {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* a markup tag name */
.tag {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* a markup attribute name */
.atn {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* a markup attribute value */
.atv {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* a declaration */
.dec {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* a variable name */
.var {
color: #000000;
font-weight: normal;
font-style: normal;
}
/* a function name */
.fun {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin-top: 0;
margin-bottom: 0;
}
/* Tomorrow Theme */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */
/* Pretty printing styles. Used with prettify.js. */
/* SPAN elements with the classes below are added by prettyprint. */
/* plain text */
.pln {
color: #4d4d4c; }
@media screen {
/* string content */
.str {
color: #718c00; }
/* a keyword */
.kwd {
color: #8959a8; }
/* a comment */
.com {
color: #8e908c; }
/* a type name */
.typ {
color: #4271ae; }
/* a literal value */
.lit {
color: #f5871f; }
/* punctuation */
.pun {
color: #4d4d4c; }
/* lisp open bracket */
.opn {
color: #4d4d4c; }
/* lisp close bracket */
.clo {
color: #4d4d4c; }
/* a markup tag name */
.tag {
color: #c82829; }
/* a markup attribute name */
.atn {
color: #f5871f; }
/* a markup attribute value */
.atv {
color: #3e999f; }
/* a declaration */
.dec {
color: #f5871f; }
/* a variable name */
.var {
color: #c82829; }
/* a function name */
.fun {
color: #4271ae; } }
/* Use higher contrast and text-weight for printable form. */
@media print, projection {
.str {
color: #060; }
.kwd {
color: #006;
font-weight: bold; }
.com {
color: #600;
font-style: italic; }
.typ {
color: #404;
font-weight: bold; }
.lit {
color: #044; }
.pun, .opn, .clo {
color: #440; }
.tag {
color: #006;
font-weight: bold; }
.atn {
color: #404; }
.atv {
color: #060; } }
/* Style */
/*
pre.prettyprint {
background: white;
font-family: Consolas, Monaco, 'Andale Mono', monospace;
font-size: 12px;
line-height: 1.5;
border: 1px solid #ccc;
padding: 10px; }
*/
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin-top: 0;
margin-bottom: 0; }
/* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L4,
li.L5,
li.L6,
li.L7,
li.L8,
li.L9 {
/* */ }
/* Alternate shading for lines */
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 {
/* */ }
This diff is collapsed.
This diff is collapsed.
{
"name": "tmp",
"version": "0.0.31",
"version": "0.0.33",
"description": "Temporary file and directory creator",
"author": "KARASZI István <github@spam.raszi.hu> (http://raszi.hu/)",
"keywords": [
......@@ -16,20 +16,23 @@
"repository": "raszi/node-tmp",
"homepage": "http://github.com/raszi/node-tmp",
"bugs": {
"url": "http://github.com/raszi/node-tmp/issues"
"url": "http://github.com/raszi/node-tmp/issues"
},
"engines": {
"node": ">=0.4.0"
"node": ">=0.6.0"
},
"dependencies": {
"os-tmpdir": "~1.0.1"
"os-tmpdir": "~1.0.2"
},
"devDependencies": {
"vows": "~0.7.0"
},
"main": "lib/tmp.js",
"files": ["lib/"],
"files": [
"lib/"
],
"scripts": {
"test": "vows test/*-test.js"
"test": "vows test/*-test.js",
"doc": "jsdoc -c .jsdoc.json"
}
}
This diff is collapsed.
/* eslint-disable no-octal */
var
vows = require('vows'),
assert = require('assert'),
......@@ -180,7 +182,7 @@ vows.describe('Synchronous directory creation').addBatch({
'should remove target'
);
},
'should not remove contents of symlink dir': function(err, name) {
'should not remove contents of symlink dir': function() {
assert.ok(
existsSync(__dirname + '/symlinkme/file.js'),
'should not remove symlinked directory\'s content'
......@@ -208,7 +210,7 @@ vows.describe('Synchronous directory creation').addBatch({
'should not return with an error': assert.isNull,
'should return with a name': Test.assertName,
'should be a directory': function (err, name) {
_testDir(040700)({name:name});
_testDir(040700)({name:name});
// make sure that everything gets cleaned up
fs.unlinkSync(path.join(name, 'should-be-removed.file'));
fs.unlinkSync(path.join(name, 'symlinkme-target'));
......
/* eslint-disable no-octal */
var
vows = require('vows'),
assert = require('assert'),
......@@ -174,7 +176,7 @@ vows.describe('Directory creation').addBatch({
'should remove target'
);
},
'should not remove contents of symlink dir': function(err, name) {
'should not remove contents of symlink dir': function() {
assert.ok(
existsSync(__dirname + '/symlinkme/file.js'),
'should not remove symlinked directory\'s content'
......
This diff is collapsed.
/* eslint-disable no-octal */
var
vows = require('vows'),
assert = require('assert'),
......@@ -240,6 +242,30 @@ vows.describe('File creation').addBatch({
removeCallback();
assert.ok(!existsSync(name), 'File should be removed');
}
}
},
'issue115 async: user deleted tmp file prior to cleanup': {
topic: function () {
Test.testIssue115File(this.callback);
},
'should not return with an error': assert.isNull,
'should return with a name': Test.assertName,
'should not exist': function (err, name) {
assert.ok(!existsSync(name), 'File should be removed');
}
},
'issue115 sync: user deleted tmp file prior to cleanup': {
topic: function () {
Test.testIssue115FileSync(this.callback);
},
'should not return with an error': assert.isNull,
'should return with a name': Test.assertName,
'should not exist': function (err, name) {
assert.ok(!existsSync(name), 'File should be removed');
}
},
}).exportTo(module);
This diff is collapsed.
This diff is collapsed.
......@@ -7,6 +7,6 @@ try {
spawn.out(result.name, spawn.exit);
}
catch (e) {
spawn.err(err, spawn.exit);
spawn.err(e.toString(), spawn.exit);
}
This diff is collapsed.
var
fs = require('fs'),
tmp = require('../lib/tmp');
var tmp = require('../lib/tmp');
function _writeSync(stream, str, cb) {
var flushed = stream.write(str);
......
var
fs = require('fs'),
tmp = require('../lib/tmp');
var tmp = require('../lib/tmp');
function _writeSync(stream, str, cb) {
var flushed = stream.write(str);
......
This diff is collapsed.
This diff is collapsed.