diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3f93687 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +coverage/ +public/ +pages/ diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..5062e5c --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1 @@ +export declare let openUrl: (urlArg: any) => Promise; diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..ed3181e --- /dev/null +++ b/dist/index.js @@ -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 \ No newline at end of file diff --git a/package.json b/package.json index ba70c71..5814061 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "1.0.0", "description": "open things", "main": "dist/index.js", + "typings": "dist/index.d.ts", "scripts": { "test": "(npmts)" }, @@ -18,5 +19,9 @@ "bugs": { "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" + } } diff --git a/ts/index.ts b/ts/index.ts new file mode 100644 index 0000000..41ff91b --- /dev/null +++ b/ts/index.ts @@ -0,0 +1,5 @@ +import open = require('open') + +export let openUrl = async (urlArg) => { + open(urlArg) +} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..6631396 --- /dev/null +++ b/yarn.lock @@ -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"