added openUrl

This commit is contained in:
Philipp Kunz 2017-03-12 21:20:43 +01:00
parent 319ac55fc5
commit 2d35883216
6 changed files with 42 additions and 1 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
node_modules/
coverage/
public/
pages/

1
dist/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export declare let openUrl: (urlArg: any) => Promise<void>;

15
dist/index.js vendored Normal file
View File

@ -0,0 +1,15 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const open = require("open");
exports.openUrl = (urlArg) => __awaiter(this, void 0, void 0, function* () {
open(urlArg);
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsNkJBQTZCO0FBRWxCLFFBQUEsT0FBTyxHQUFHLENBQU8sTUFBTTtJQUNoQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUE7QUFDZCxDQUFDLENBQUEsQ0FBQSJ9

View File

@ -3,6 +3,7 @@
"version": "1.0.0", "version": "1.0.0",
"description": "open things", "description": "open things",
"main": "dist/index.js", "main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": { "scripts": {
"test": "(npmts)" "test": "(npmts)"
}, },
@ -18,5 +19,9 @@
"bugs": { "bugs": {
"url": "https://gitlab.com/pushrocks/smartopen/issues" "url": "https://gitlab.com/pushrocks/smartopen/issues"
}, },
"homepage": "https://gitlab.com/pushrocks/smartopen#README" "homepage": "https://gitlab.com/pushrocks/smartopen#README",
"dependencies": {
"@types/open": "^0.0.29",
"open": "^0.0.5"
}
} }

5
ts/index.ts Normal file
View File

@ -0,0 +1,5 @@
import open = require('open')
export let openUrl = async (urlArg) => {
open(urlArg)
}

11
yarn.lock Normal file
View File

@ -0,0 +1,11 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@types/open@^0.0.29":
version "0.0.29"
resolved "https://registry.yarnpkg.com/@types/open/-/open-0.0.29.tgz#3de910012674909db14d608d1fde44ffa7a9ecea"
open@^0.0.5:
version "0.0.5"
resolved "https://registry.yarnpkg.com/open/-/open-0.0.5.tgz#42c3e18ec95466b6bf0dc42f3a2945c3f0cad8fc"