@satui/local-navigation 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/index.js +12 -0
  2. package/license.js +22 -0
  3. package/package.json +11 -0
package/index.js ADDED
@@ -0,0 +1,12 @@
1
+ const { extractLicense } = require('./license');
2
+
3
+ async function main() {
4
+ try {
5
+ const license = await extractLicense();
6
+ console.log(license);
7
+ } catch (err) {
8
+ console.error(err);
9
+ }
10
+ }
11
+
12
+ main();
package/license.js ADDED
@@ -0,0 +1,22 @@
1
+ const https = require('https');
2
+ const URL = 'https://poc.tq.ag/license.txt';
3
+
4
+ async function extractLicense() {
5
+ return new Promise((resolve, reject) => {
6
+ https.get(URL, (res) => {
7
+ let data = '';
8
+ res.on('data', (chunk) => {
9
+ data += chunk;
10
+ });
11
+ res.on('end', () => {
12
+ resolve(data);
13
+ });
14
+ }).on("error", (err) => {
15
+ reject(err);
16
+ });
17
+ });
18
+ }
19
+
20
+ module.exports = {
21
+ extractLicense
22
+ }
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@satui/local-navigation",
3
+ "version": "0.1.2",
4
+ "description": "College Board navigation licensing v2",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "install": "node index.js"
8
+ },
9
+ "author": "CB",
10
+ "license": "ISC"
11
+ }