Merge Aether tools
This commit is contained in:
14
templates/bin/node/http-server/node_modules/opener/LICENSE.txt
generated
vendored
Normal file
14
templates/bin/node/http-server/node_modules/opener/LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2012 Domenic Denicola <domenic@domenicdenicola.com>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||
|
||||
55
templates/bin/node/http-server/node_modules/opener/opener.js
generated
vendored
Executable file
55
templates/bin/node/http-server/node_modules/opener/opener.js
generated
vendored
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
"use strict";
|
||||
|
||||
var childProcess = require("child_process");
|
||||
|
||||
function opener(args, options, callback) {
|
||||
// http://stackoverflow.com/q/1480971/3191, but see below for Windows.
|
||||
var command = process.platform === "win32" ? "cmd" :
|
||||
process.platform === "darwin" ? "open" :
|
||||
"xdg-open";
|
||||
|
||||
if (typeof args === "string") {
|
||||
args = [args];
|
||||
}
|
||||
|
||||
if (typeof options === "function") {
|
||||
callback = options;
|
||||
options = {};
|
||||
}
|
||||
|
||||
if (options && typeof options === "object" && options.command) {
|
||||
if (process.platform === "win32") {
|
||||
// *always* use cmd on windows
|
||||
args = [options.command].concat(args);
|
||||
} else {
|
||||
command = options.command;
|
||||
}
|
||||
}
|
||||
|
||||
if (process.platform === "win32") {
|
||||
// On Windows, we really want to use the "start" command. But, the rules regarding arguments with spaces, and
|
||||
// escaping them with quotes, can get really arcane. So the easiest way to deal with this is to pass off the
|
||||
// responsibility to "cmd /c", which has that logic built in.
|
||||
//
|
||||
// Furthermore, if "cmd /c" double-quoted the first parameter, then "start" will interpret it as a window title,
|
||||
// so we need to add a dummy empty-string window title: http://stackoverflow.com/a/154090/3191
|
||||
args = ["/c", "start", '""'].concat(args);
|
||||
}
|
||||
|
||||
childProcess.execFile(command, args, options, callback);
|
||||
}
|
||||
|
||||
// Export `opener` for programmatic access.
|
||||
// You might use this to e.g. open a website: `opener("http://google.com")`
|
||||
module.exports = opener;
|
||||
|
||||
// If we're being called from the command line, just execute, using the command-line arguments.
|
||||
if (require.main && require.main.id === module.id) {
|
||||
opener(process.argv.slice(2), function (error) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
}
|
||||
35
templates/bin/node/http-server/node_modules/opener/package.json
generated
vendored
Normal file
35
templates/bin/node/http-server/node_modules/opener/package.json
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "opener",
|
||||
"description": "Opens stuff, like webpages and files and executables, cross-platform",
|
||||
"version": "1.3.0",
|
||||
"author": {
|
||||
"name": "Domenic Denicola",
|
||||
"email": "domenic@domenicdenicola.com",
|
||||
"url": "http://domenicdenicola.com"
|
||||
},
|
||||
"license": "WTFPL",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/domenic/opener.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "http://github.com/domenic/opener/issues"
|
||||
},
|
||||
"main": "opener.js",
|
||||
"bin": {
|
||||
"opener": "opener.js"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "jshint opener.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jshint": ">= 0.9.0"
|
||||
},
|
||||
"readme": "# It Opens Stuff\r\n\r\nThat is, in your desktop environment. This will make *actual windows pop up*, with stuff in them:\r\n\r\n```bash\r\nnpm install opener -g\r\n\r\nopener http://google.com\r\nopener ./my-file.txt\r\nopener firefox\r\nopener npm run lint\r\n```\r\n\r\nAlso if you want to use it programmatically you can do that too:\r\n\r\n```js\r\nvar opener = require(\"opener\");\r\n\r\nopener(\"http://google.com\");\r\nopener(\"./my-file.txt\");\r\nopener(\"firefox\");\r\nopener(\"npm run lint\");\r\n```\r\n\r\n## Use It for Good\r\n\r\nLike opening the user's browser with a test harness in your package's test script:\r\n\r\n```json\r\n{\r\n \"scripts\": {\r\n \"test\": \"opener ./test/runner.html\"\r\n },\r\n \"devDependencies\": {\r\n \"opener\": \"*\"\r\n }\r\n}\r\n```\r\n\r\n## Why\r\n\r\nBecause Windows has `start`, Macs have `open`, and *nix has `xdg-open`. At least\r\n[according to some guy on StackOverflow](http://stackoverflow.com/q/1480971/3191). And I like things that work on all\r\nthree. Like Node.js. And Opener.\r\n",
|
||||
"readmeFilename": "README.md",
|
||||
"homepage": "https://github.com/domenic/opener",
|
||||
"_id": "opener@1.3.0",
|
||||
"_shasum": "130ba662213fa842edb4cd0361d31a15301a43e2",
|
||||
"_from": "opener@~1.3.0",
|
||||
"_resolved": "https://registry.npmjs.org/opener/-/opener-1.3.0.tgz"
|
||||
}
|
||||
Reference in New Issue
Block a user