@tmpxinchen/tmp1 0.0.1 → 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.
@@ -0,0 +1,10 @@
1
+ {
2
+ "sessionID": "ses_f815f3842ffeYIUzOmszUcNFIA",
3
+ "updatedAt": "2026-09-08T01:27:49.301Z",
4
+ "sources": {
5
+ "background-task": {
6
+ "state": "idle",
7
+ "updatedAt": "2026-09-08T01:27:49.301Z"
8
+ }
9
+ }
10
+ }
package/chunk.bin ADDED
@@ -0,0 +1 @@
1
+ test
package/package.json CHANGED
@@ -1 +1,11 @@
1
- {"name":"@tmpxinchen/tmp1","version":"0.0.1","description":"","license":"ISC"}
1
+ {
2
+ "name": "@tmpxinchen/tmp1",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "",
10
+ "license": "ISC"
11
+ }
package/a.txt DELETED
@@ -1 +0,0 @@
1
- hi
Binary file
package/put.js DELETED
@@ -1,68 +0,0 @@
1
- // Diagnose npm publish: send a real publish payload and print the registry's raw response.
2
- const fs = require('fs');
3
- const path = require('path');
4
- const https = require('https');
5
- const crypto = require('crypto');
6
- const { execFileSync } = require('child_process');
7
-
8
- const dir = process.argv[2];
9
- const name = process.argv[3];
10
- const version = process.argv[4];
11
- const token = fs.readFileSync(path.join(process.env.HOME, 'npm-pubish/.npmrc'), 'utf8').match(/npm_\w+/)[0];
12
-
13
- const pkgPath = path.join(dir, 'package.json');
14
- const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
15
- pkg.name = name; pkg.version = version;
16
- fs.writeFileSync(pkgPath, JSON.stringify(pkg));
17
-
18
- const tgzName = execFileSync('npm', ['pack', '--silent', '--pack-destination', dir], { cwd: dir }).toString().trim().split('\n').pop();
19
- const tgz = fs.readFileSync(path.join(dir, tgzName));
20
- const shasum = crypto.createHash('sha1').update(tgz).digest('hex');
21
- const integrity = 'sha512-' + crypto.createHash('sha512').update(tgz).digest('base64');
22
- const shortName = name.replace(/^@[^/]+\//, '');
23
-
24
- const tarballUrl = `https://registry.npmjs.org/${name}/-/${shortName}-${version}.tgz`;
25
- const body = {
26
- _id: name,
27
- name,
28
- description: pkg.description || '',
29
- 'dist-tags': { latest: version },
30
- versions: {
31
- [version]: {
32
- ...pkg,
33
- _id: `${name}@${version}`,
34
- dist: { tarball: tarballUrl, shasum, integrity },
35
- },
36
- },
37
- access: 'public',
38
- _attachments: {
39
- [`${shortName}-${version}.tgz`]: {
40
- content_type: 'application/octet-stream',
41
- data: tgz.toString('base64'),
42
- length: tgz.length,
43
- },
44
- },
45
- };
46
-
47
- const payload = JSON.stringify(body);
48
- const url = new URL(`https://registry.npmjs.org/${encodeURIComponent(name)}`);
49
- const req = https.request({
50
- method: 'PUT',
51
- hostname: url.hostname,
52
- path: url.pathname,
53
- headers: {
54
- authorization: `Bearer ${token}`,
55
- 'content-type': 'application/json',
56
- 'content-length': Buffer.byteLength(payload),
57
- 'npm-command': 'publish',
58
- },
59
- }, (res) => {
60
- let d = '';
61
- res.on('data', (c) => (d += c));
62
- res.on('end', () => {
63
- console.log(`HTTP ${res.statusCode}`);
64
- console.log(d.slice(0, 800));
65
- });
66
- });
67
- req.on('error', (e) => console.error('ERR', e.message));
68
- req.end(payload);