social-archiver 0.1.2
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/LICENSE +21 -0
- package/README.md +16 -0
- package/bin/social-archiver.js +58 -0
- package/package.json +32 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Hyungyun Lim
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Social Archiver CLI for npm
|
|
2
|
+
|
|
3
|
+
This package runs the official native Social Archiver CLI binary for the
|
|
4
|
+
current platform. The native payload is built from the same immutable release
|
|
5
|
+
as the Homebrew and direct-install channels; npm is only the launcher and
|
|
6
|
+
delivery mechanism.
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npx -y social-archiver@0.1.2 --version
|
|
10
|
+
npm install --global social-archiver
|
|
11
|
+
social-archiver login
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The recommended installation for macOS and Linux is the native installer or
|
|
15
|
+
Homebrew because those paths do not require Node.js. npm/npx is supported for
|
|
16
|
+
users who already have Node.js 20 or newer.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const { spawn } = require('node:child_process');
|
|
5
|
+
const { dirname, join } = require('node:path');
|
|
6
|
+
|
|
7
|
+
const PLATFORM_PACKAGES = {
|
|
8
|
+
'darwin-arm64': '@social-archiver/cli-darwin-arm64',
|
|
9
|
+
'darwin-x64': '@social-archiver/cli-darwin-x64',
|
|
10
|
+
'linux-x64': '@social-archiver/cli-linux-x64',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const platformKey = `${process.platform}-${process.arch}`;
|
|
14
|
+
const packageName = PLATFORM_PACKAGES[platformKey];
|
|
15
|
+
if (!packageName) {
|
|
16
|
+
console.error(
|
|
17
|
+
`Social Archiver CLI does not support ${process.platform}/${process.arch} through npm.`,
|
|
18
|
+
);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let packageRoot;
|
|
23
|
+
try {
|
|
24
|
+
packageRoot = dirname(require.resolve(`${packageName}/package.json`));
|
|
25
|
+
} catch {
|
|
26
|
+
console.error(
|
|
27
|
+
`The native package ${packageName} is missing. ` +
|
|
28
|
+
'Reinstall without --ignore-scripts or --omit=optional.',
|
|
29
|
+
);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const binary = join(packageRoot, 'bin', 'social-archiver');
|
|
34
|
+
const helper = join(
|
|
35
|
+
packageRoot,
|
|
36
|
+
'bin',
|
|
37
|
+
'social-archiver-credential-helper',
|
|
38
|
+
);
|
|
39
|
+
const child = spawn(binary, process.argv.slice(2), {
|
|
40
|
+
stdio: 'inherit',
|
|
41
|
+
shell: false,
|
|
42
|
+
env: {
|
|
43
|
+
...process.env,
|
|
44
|
+
SOCIAL_ARCHIVER_CREDENTIAL_HELPER: helper,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
child.on('error', (error) => {
|
|
49
|
+
console.error(`Unable to start Social Archiver CLI: ${error.message}`);
|
|
50
|
+
process.exit(1);
|
|
51
|
+
});
|
|
52
|
+
child.on('exit', (code, signal) => {
|
|
53
|
+
if (signal) {
|
|
54
|
+
process.kill(process.pid, signal);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
process.exit(code ?? 1);
|
|
58
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "social-archiver",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Archive social and web content with the native Social Archiver CLI.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/hyungyunlim/obsidian-social-archiver.git",
|
|
9
|
+
"directory": "apps/social-archiver-cli"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://social-archive.org",
|
|
12
|
+
"bin": {
|
|
13
|
+
"social-archiver": "bin/social-archiver.js"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"bin",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=20"
|
|
22
|
+
},
|
|
23
|
+
"optionalDependencies": {
|
|
24
|
+
"@social-archiver/cli-darwin-arm64": "0.1.2",
|
|
25
|
+
"@social-archiver/cli-darwin-x64": "0.1.2",
|
|
26
|
+
"@social-archiver/cli-linux-x64": "0.1.2"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public",
|
|
30
|
+
"provenance": true
|
|
31
|
+
}
|
|
32
|
+
}
|