test-npm-test1-mydep-2 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/main.js +1 -0
- package/make-poc.js +24 -0
- package/package.json +14 -0
package/main.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
console.log('hello')
|
package/make-poc.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// make-poc.js
|
|
2
|
+
const fs = require('node:fs')
|
|
3
|
+
|
|
4
|
+
const packageJsonPath = './package.json'
|
|
5
|
+
const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))
|
|
6
|
+
|
|
7
|
+
const args = process.argv.slice(2)
|
|
8
|
+
|
|
9
|
+
function getArg(name, defaultValue) {
|
|
10
|
+
const index = args.indexOf(name)
|
|
11
|
+
return index !== -1 && index + 1 < args.length
|
|
12
|
+
? args[index + 1]
|
|
13
|
+
: defaultValue
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const packageName = getArg('--package-name', 'any-dep-name')
|
|
17
|
+
const length = Number.parseInt(getArg('--length', '128000'), 10)
|
|
18
|
+
|
|
19
|
+
pkg.dependencies ??= Object.create(null)
|
|
20
|
+
pkg.dependencies[packageName] = 'v'.repeat(Number.isInteger(length) && length > 0 ? length : 128000)
|
|
21
|
+
|
|
22
|
+
fs.writeFileSync(packageJsonPath, `${JSON.stringify(pkg, null, 2)}\n`)
|
|
23
|
+
|
|
24
|
+
console.log(`Generated dependency "${packageName}" with version length ${length}`)
|
package/package.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "test-npm-test1-mydep-2",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "main.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [],
|
|
10
|
+
"type": "commonjs",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"minimalistic-assert": "^1.0.1"
|
|
13
|
+
}
|
|
14
|
+
}
|