[Pkg-javascript-commits] [node-is-builtin-module] 01/04: Import Upstream version 1.0.0

Sruthi Chandran srud-guest at moszumanska.debian.org
Wed Oct 26 05:25:21 UTC 2016


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

srud-guest pushed a commit to branch master
in repository node-is-builtin-module.

commit 0f276a6a79f9c80578f2c13585671408f83a4cc1
Author: Sruthi <srud at disroot.org>
Date:   Wed Oct 26 10:22:38 2016 +0530

    Import Upstream version 1.0.0
---
 .editorconfig  | 15 +++++++++++++++
 .gitattributes |  1 +
 .gitignore     |  1 +
 .jshintrc      | 12 ++++++++++++
 .travis.yml    |  6 ++++++
 index.js       | 10 ++++++++++
 license        | 21 +++++++++++++++++++++
 package.json   | 43 +++++++++++++++++++++++++++++++++++++++++++
 readme.md      | 33 +++++++++++++++++++++++++++++++++
 test.js        |  9 +++++++++
 10 files changed, 151 insertions(+)

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..8f9d77e
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,15 @@
+root = true
+
+[*]
+indent_style = tab
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[{package.json,*.yml}]
+indent_style = space
+indent_size = 2
+
+[*.md]
+trim_trailing_whitespace = false
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..176a458
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+* text=auto
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+node_modules
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..9fe1be2
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,12 @@
+{
+	"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
new file mode 100644
index 0000000..dedfc07
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,6 @@
+sudo: false
+language: node_js
+node_js:
+  - 'iojs'
+  - '0.12'
+  - '0.10'
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..b6cfa61
--- /dev/null
+++ b/index.js
@@ -0,0 +1,10 @@
+'use strict';
+var builtinModules = require('builtin-modules');
+
+module.exports = function (str) {
+	if (typeof str !== 'string') {
+		throw new TypeError('Expected a string');
+	}
+
+	return builtinModules.indexOf(str) !== -1;
+};
diff --git a/license b/license
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus at gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN 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.
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..4a49ec0
--- /dev/null
+++ b/package.json
@@ -0,0 +1,43 @@
+{
+  "name": "is-builtin-module",
+  "version": "1.0.0",
+  "description": "Check if a string matches the name of a Node.js builtin module",
+  "license": "MIT",
+  "repository": "sindresorhus/is-builtin-module",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus at gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "scripts": {
+    "test": "node test.js"
+  },
+  "files": [
+    "index.js"
+  ],
+  "keywords": [
+    "builtin",
+    "built-in",
+    "builtins",
+    "node",
+    "modules",
+    "core",
+    "bundled",
+    "list",
+    "array",
+    "names",
+    "is",
+    "detect",
+    "check",
+    "match"
+  ],
+  "dependencies": {
+    "builtin-modules": "^1.0.0"
+  },
+  "devDependencies": {
+    "ava": "0.0.4"
+  }
+}
diff --git a/readme.md b/readme.md
new file mode 100644
index 0000000..798dcf4
--- /dev/null
+++ b/readme.md
@@ -0,0 +1,33 @@
+# is-builtin-module [![Build Status](https://travis-ci.org/sindresorhus/is-builtin-module.svg?branch=master)](https://travis-ci.org/sindresorhus/is-builtin-module)
+
+> Check if a string matches the name of a Node.js builtin module
+
+
+## Install
+
+```
+$ npm install --save is-builtin-module
+```
+
+
+## Usage
+
+```js
+var isBuiltinModule = require('is-builtin-module');
+
+isBuiltinModule('fs');
+//=> true
+
+isBuiltinModule('unicorn');
+//=> false :(
+```
+
+
+## Related
+
+- [builtin-modules](https://github.com/sindresorhus/builtin-modules) - List of the Node.js builtin modules
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..d236a1b
--- /dev/null
+++ b/test.js
@@ -0,0 +1,9 @@
+'use strict';
+var test = require('ava');
+var isBuiltinModule = require('./');
+
+test(function (t) {
+	t.assert(isBuiltinModule('fs'));
+	t.assert(isBuiltinModule('console'));
+	t.end();
+});

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-is-builtin-module.git



More information about the Pkg-javascript-commits mailing list