[Pkg-javascript-commits] [node-os-tmpdir] 01/08: New upstream version 1.0.2

Ross Gammon ross-guest at moszumanska.debian.org
Fri May 12 20:59:39 UTC 2017


This is an automated email from the git hooks/post-receive script.

ross-guest pushed a commit to branch master
in repository node-os-tmpdir.

commit 07faab6255e1b6ef25782f33924727c3e73208f0
Author: Ross Gammon <rosco2 at ubuntu.com>
Date:   Fri May 12 21:25:56 2017 +0200

    New upstream version 1.0.2
---
 .editorconfig  |  3 ---
 .gitattributes |  1 +
 .jshintrc      | 12 ------------
 .travis.yml    |  3 ++-
 index.js       |  2 +-
 package.json   |  7 ++++---
 readme.md      | 14 +++++---------
 test.js        | 45 +++++++++++++++++++++------------------------
 8 files changed, 34 insertions(+), 53 deletions(-)

diff --git a/.editorconfig b/.editorconfig
index 8f9d77e..98a761d 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -10,6 +10,3 @@ insert_final_newline = true
 [{package.json,*.yml}]
 indent_style = space
 indent_size = 2
-
-[*.md]
-trim_trailing_whitespace = false
diff --git a/.gitattributes b/.gitattributes
index 176a458..391f0a4 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1 +1,2 @@
 * text=auto
+*.js text eol=lf
diff --git a/.jshintrc b/.jshintrc
deleted file mode 100644
index 9fe1be2..0000000
--- a/.jshintrc
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-	"node": true,
-	"esnext": true,
-	"bitwise": true,
-	"curly": true,
-	"immed": true,
-	"newcap": true,
-	"noarg": true,
-	"undef": true,
-	"unused": "vars",
-	"strict": true
-}
diff --git a/.travis.yml b/.travis.yml
index dedfc07..2c6e9b0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,7 @@
 sudo: false
 language: node_js
 node_js:
-  - 'iojs'
+  - '6'
+  - '4'
   - '0.12'
   - '0.10'
diff --git a/index.js b/index.js
index 52d90bf..2077b1c 100644
--- a/index.js
+++ b/index.js
@@ -2,7 +2,7 @@
 var isWindows = process.platform === 'win32';
 var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/;
 
-// https://github.com/nodejs/io.js/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43
+// https://github.com/nodejs/node/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43
 module.exports = function () {
 	var path;
 
diff --git a/package.json b/package.json
index d8501b8..180a317 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "os-tmpdir",
-  "version": "1.0.1",
+  "version": "1.0.2",
   "description": "Node.js os.tmpdir() ponyfill",
   "license": "MIT",
   "repository": "sindresorhus/os-tmpdir",
@@ -13,7 +13,7 @@
     "node": ">=0.10.0"
   },
   "scripts": {
-    "test": "node test.js"
+    "test": "xo && ava"
   },
   "files": [
     "index.js"
@@ -35,6 +35,7 @@
     "environment"
   ],
   "devDependencies": {
-    "ava": "0.0.4"
+    "ava": "*",
+    "xo": "^0.16.0"
   }
 }
diff --git a/readme.md b/readme.md
index 54d4c6e..c09f7ed 100644
--- a/readme.md
+++ b/readme.md
@@ -1,12 +1,8 @@
 # os-tmpdir [![Build Status](https://travis-ci.org/sindresorhus/os-tmpdir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-tmpdir)
 
-> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) ponyfill
+> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) [ponyfill](https://ponyfill.com)
 
-> Ponyfill: A polyfill that doesn't overwrite the native method
-
-Use this instead of `require('os').tmpdir()` to get a consistent behaviour on different Node.js versions (even 0.8).
-
-*This is actually taken from io.js 2.0.2 as it contains some fixes that haven't bubbled up to Node.js yet.*
+Use this instead of `require('os').tmpdir()` to get a consistent behavior on different Node.js versions (even 0.8).
 
 
 ## Install
@@ -19,10 +15,10 @@ $ npm install --save os-tmpdir
 ## Usage
 
 ```js
-var osTmpdir = require('os-tmpdir');
+const osTmpdir = require('os-tmpdir');
 
 osTmpdir();
-//=> /var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T
+//=> '/var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T'
 ```
 
 
@@ -33,4 +29,4 @@ See the [`os.tmpdir()` docs](https://nodejs.org/api/os.html#os_os_tmpdir).
 
 ## License
 
-MIT © [Sindre Sorhus](http://sindresorhus.com)
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/test.js b/test.js
index cc4584e..dbb4c04 100644
--- a/test.js
+++ b/test.js
@@ -1,45 +1,42 @@
-'use strict';
-var assert = require('assert');
-var test = require('ava');
-var osTmpdir = require('./');
-var os = {tmpdir: osTmpdir};
+import test from 'ava';
+import m from './';
 
-test(function (t) {
-	// https://github.com/nodejs/io.js/blob/3e7a14381497a3b73dda68d05b5130563cdab420/test/parallel/test-os.js#L6-L38
+const os = {tmpdir: m};
+
+test(t => {
+	// https://github.com/nodejs/node/blob/3e7a14381497a3b73dda68d05b5130563cdab420/test/parallel/test-os.js#L6-L38
 	process.env.TMPDIR = '/tmpdir';
 	process.env.TMP = '/tmp';
 	process.env.TEMP = '/temp';
 
 	if (process.platform === 'win32') {
-		assert.equal(os.tmpdir(), '/temp');
+		t.is(os.tmpdir(), '/temp');
 		process.env.TEMP = '';
-		assert.equal(os.tmpdir(), '/tmp');
+		t.is(os.tmpdir(), '/tmp');
 		process.env.TMP = '';
-		var expected = (process.env.SystemRoot || process.env.windir) + '\\temp';
-		assert.equal(os.tmpdir(), expected);
+		const expected = (process.env.SystemRoot || process.env.windir) + '\\temp';
+		t.is(os.tmpdir(), expected);
 		process.env.TEMP = '\\temp\\';
-		assert.equal(os.tmpdir(), '\\temp');
+		t.is(os.tmpdir(), '\\temp');
 		process.env.TEMP = '\\tmpdir/';
-		assert.equal(os.tmpdir(), '\\tmpdir/');
+		t.is(os.tmpdir(), '\\tmpdir/');
 		process.env.TEMP = '\\';
-		assert.equal(os.tmpdir(), '\\');
+		t.is(os.tmpdir(), '\\');
 		process.env.TEMP = 'C:\\';
-		assert.equal(os.tmpdir(), 'C:\\');
+		t.is(os.tmpdir(), 'C:\\');
 	} else {
-		assert.equal(os.tmpdir(), '/tmpdir');
+		t.is(os.tmpdir(), '/tmpdir');
 		process.env.TMPDIR = '';
-		assert.equal(os.tmpdir(), '/tmp');
+		t.is(os.tmpdir(), '/tmp');
 		process.env.TMP = '';
-		assert.equal(os.tmpdir(), '/temp');
+		t.is(os.tmpdir(), '/temp');
 		process.env.TEMP = '';
-		assert.equal(os.tmpdir(), '/tmp');
+		t.is(os.tmpdir(), '/tmp');
 		process.env.TMPDIR = '/tmpdir/';
-		assert.equal(os.tmpdir(), '/tmpdir');
+		t.is(os.tmpdir(), '/tmpdir');
 		process.env.TMPDIR = '/tmpdir\\';
-		assert.equal(os.tmpdir(), '/tmpdir\\');
+		t.is(os.tmpdir(), '/tmpdir\\');
 		process.env.TMPDIR = '/';
-		assert.equal(os.tmpdir(), '/');
+		t.is(os.tmpdir(), '/');
 	}
-
-	t.end();
 });

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-os-tmpdir.git



More information about the Pkg-javascript-commits mailing list