[Pkg-javascript-commits] [node-builtin-modules] 01/04: Import Upstream version 1.1.1
Sruthi Chandran
srud-guest at moszumanska.debian.org
Tue Oct 25 03:46:39 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-builtin-modules.
commit dd4ad6f0e7519fa34518ade56888c86009dbc751
Author: Sruthi <srud at disroot.org>
Date: Mon Oct 24 13:44:26 2016 +0530
Import Upstream version 1.1.1
---
.editorconfig | 15 +++++++++++++++
.gitattributes | 1 +
.gitignore | 1 +
.travis.yml | 6 ++++++
builtin-modules.json | 35 +++++++++++++++++++++++++++++++++++
index.js | 10 ++++++++++
license | 21 +++++++++++++++++++++
make.js | 5 +++++
package.json | 40 ++++++++++++++++++++++++++++++++++++++++
readme.md | 41 +++++++++++++++++++++++++++++++++++++++++
static.js | 2 ++
test.js | 14 ++++++++++++++
12 files changed, 191 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/.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/builtin-modules.json b/builtin-modules.json
new file mode 100644
index 0000000..72670f6
--- /dev/null
+++ b/builtin-modules.json
@@ -0,0 +1,35 @@
+[
+ "assert",
+ "buffer",
+ "child_process",
+ "cluster",
+ "console",
+ "constants",
+ "crypto",
+ "dgram",
+ "dns",
+ "domain",
+ "events",
+ "fs",
+ "http",
+ "https",
+ "module",
+ "net",
+ "os",
+ "path",
+ "process",
+ "punycode",
+ "querystring",
+ "readline",
+ "repl",
+ "stream",
+ "string_decoder",
+ "timers",
+ "tls",
+ "tty",
+ "url",
+ "util",
+ "v8",
+ "vm",
+ "zlib"
+]
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..9ef35ab
--- /dev/null
+++ b/index.js
@@ -0,0 +1,10 @@
+'use strict';
+
+var blacklist = [
+ 'freelist',
+ 'sys'
+];
+
+module.exports = Object.keys(process.binding('natives')).filter(function (el) {
+ return !/^_|^internal|\//.test(el) && blacklist.indexOf(el) === -1;
+}).sort();
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/make.js b/make.js
new file mode 100644
index 0000000..4f53f75
--- /dev/null
+++ b/make.js
@@ -0,0 +1,5 @@
+'use strict';
+var fs = require('fs');
+var builtinModules = require('./');
+
+fs.writeFileSync('builtin-modules.json', JSON.stringify(builtinModules, null, '\t') + '\n');
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..430749a
--- /dev/null
+++ b/package.json
@@ -0,0 +1,40 @@
+{
+ "name": "builtin-modules",
+ "version": "1.1.1",
+ "description": "List of the Node.js builtin modules",
+ "license": "MIT",
+ "repository": "sindresorhus/builtin-modules",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus at gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "xo && ava",
+ "make": "node make.js"
+ },
+ "files": [
+ "index.js",
+ "static.js",
+ "builtin-modules.json"
+ ],
+ "keywords": [
+ "builtin",
+ "built-in",
+ "builtins",
+ "node",
+ "modules",
+ "core",
+ "bundled",
+ "list",
+ "array",
+ "names"
+ ],
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ }
+}
diff --git a/readme.md b/readme.md
new file mode 100644
index 0000000..f1894b1
--- /dev/null
+++ b/readme.md
@@ -0,0 +1,41 @@
+# builtin-modules [![Build Status](https://travis-ci.org/sindresorhus/builtin-modules.svg?branch=master)](https://travis-ci.org/sindresorhus/builtin-modules)
+
+> List of the Node.js builtin modules
+
+The list is just a [JSON file](builtin-modules.json) and can be used wherever.
+
+
+## Install
+
+```
+$ npm install --save builtin-modules
+```
+
+
+## Usage
+
+```js
+var builtinModules = require('builtin-modules');
+
+console.log(builinModules);
+//=> ['assert', 'buffer', ...]
+```
+
+
+## API
+
+Returns an array of builtin modules fetched from the running Node.js version.
+
+### Static list
+
+This module also comes bundled with a static array of builtin modules generated from the latest Node.js version. You can get it with `require('builtin-modules/static');`
+
+
+## Related
+
+- [is-builtin-module](https://github.com/sindresorhus/is-builtin-module) - Check if a string matches the name of a Node.js builtin module
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/static.js b/static.js
new file mode 100644
index 0000000..9508f8f
--- /dev/null
+++ b/static.js
@@ -0,0 +1,2 @@
+'use strict';
+module.exports = require('./builtin-modules.json');
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..bf45ece
--- /dev/null
+++ b/test.js
@@ -0,0 +1,14 @@
+import test from 'ava';
+import m from './';
+import m2 from './static';
+
+test(t => {
+ console.log('Builtin modules:', m);
+
+ t.doesNotThrow(() => {
+ m.forEach(x => require(x));
+ });
+
+ t.true(m.indexOf('fs') !== -1);
+ t.true(Array.isArray(m2));
+});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-builtin-modules.git
More information about the Pkg-javascript-commits
mailing list