sne-cli 0.0.0-stage → 0.1.0-beta.4
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 +28 -2
- package/bin/sne.js +44 -0
- package/package.json +36 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 sne contributors
|
|
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
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
-
#
|
|
1
|
+
# sne-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Simple Node Environment: a fast, cross-platform Node.js version manager. It installs Node.js versions
|
|
4
|
+
from nodejs.org and switches between them, per terminal or for every terminal.
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
npm install -g sne-cli # or: yarn global add sne-cli, pnpm add -g sne-cli, bun add -g sne-cli
|
|
8
|
+
sne install lts
|
|
9
|
+
sne use 22
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The command is `sne`. This package holds a small launcher for it. The sne program itself comes from a second package for your
|
|
13
|
+
system, such as `sne-linux-x64` or `sne-win32-x64`, which your package manager picks by itself.
|
|
14
|
+
Nothing is downloaded or run at install time.
|
|
15
|
+
|
|
16
|
+
## Read this first
|
|
17
|
+
|
|
18
|
+
A global package lives inside the Node.js version that installed it. If that version is one that sne
|
|
19
|
+
manages, switching to another version with `sne use` makes the `sne` command disappear until you
|
|
20
|
+
install this package there too. So install it with a Node.js that sne does not manage, or use one of
|
|
21
|
+
the [other ways to install](https://github.com/sne-sh/sne#install), which do not need Node.js at all.
|
|
22
|
+
|
|
23
|
+
The launcher starts Node.js before sne, which adds a little time to every `sne` command.
|
|
24
|
+
|
|
25
|
+
## More
|
|
26
|
+
|
|
27
|
+
- [Documentation](https://github.com/sne-sh/sne/tree/main/docs)
|
|
28
|
+
- [Source and issues](https://github.com/sne-sh/sne)
|
|
29
|
+
- License: MIT
|
package/bin/sne.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Starts the sne program that npm, yarn, pnpm or bun installed for this system.
|
|
3
|
+
// The program itself is in a separate package, one per system, listed in optionalDependencies.
|
|
4
|
+
// Written for old Node.js versions too: sne may switch to any of them.
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
var fs = require('fs');
|
|
8
|
+
var path = require('path');
|
|
9
|
+
var spawnSync = require('child_process').spawnSync;
|
|
10
|
+
|
|
11
|
+
var name = 'sne-' + process.platform + '-' + process.arch;
|
|
12
|
+
var binary;
|
|
13
|
+
try {
|
|
14
|
+
binary = path.join(
|
|
15
|
+
path.dirname(require.resolve(name + '/package.json')),
|
|
16
|
+
process.platform === 'win32' ? 'sne.exe' : 'sne'
|
|
17
|
+
);
|
|
18
|
+
} catch (err) {
|
|
19
|
+
console.error(
|
|
20
|
+
'sne: the package ' + name + ' is not installed.\n' +
|
|
21
|
+
'Either sne has no build for this system (' + process.platform + ' ' + process.arch + '),\n' +
|
|
22
|
+
'or optional dependencies were skipped. Install again without --no-optional or --omit=optional,\n' +
|
|
23
|
+
'or use another way to install: https://github.com/sne-sh/sne#install'
|
|
24
|
+
);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (process.platform !== 'win32') {
|
|
29
|
+
// Some tools unpack files without the executable bit.
|
|
30
|
+
try {
|
|
31
|
+
fs.accessSync(binary, fs.constants.X_OK);
|
|
32
|
+
} catch (err) {
|
|
33
|
+
try {
|
|
34
|
+
fs.chmodSync(binary, 493); // 0755
|
|
35
|
+
} catch (ignored) {}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
var result = spawnSync(binary, process.argv.slice(2), { stdio: 'inherit' });
|
|
40
|
+
if (result.error) {
|
|
41
|
+
console.error('sne: could not run ' + binary + ': ' + result.error.message);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sne-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0-beta.4",
|
|
4
|
+
"description": "Simple Node Environment: a fast, cross-platform Node.js version manager",
|
|
5
|
+
"bin": {
|
|
6
|
+
"sne": "bin/sne.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin"
|
|
10
|
+
],
|
|
11
|
+
"keywords": [
|
|
12
|
+
"node",
|
|
13
|
+
"nodejs",
|
|
14
|
+
"version-manager",
|
|
15
|
+
"nvm",
|
|
16
|
+
"cli"
|
|
17
|
+
],
|
|
18
|
+
"homepage": "https://sne-sh.github.io/sne/",
|
|
19
|
+
"bugs": "https://github.com/sne-sh/sne/issues",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/sne-sh/sne.git",
|
|
23
|
+
"directory": "npm/sne"
|
|
24
|
+
},
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=8"
|
|
28
|
+
},
|
|
29
|
+
"optionalDependencies": {
|
|
30
|
+
"sne-win32-x64": "0.1.0-beta.4",
|
|
31
|
+
"sne-win32-ia32": "0.1.0-beta.4",
|
|
32
|
+
"sne-win32-arm64": "0.1.0-beta.4",
|
|
33
|
+
"sne-darwin-x64": "0.1.0-beta.4",
|
|
34
|
+
"sne-darwin-arm64": "0.1.0-beta.4",
|
|
35
|
+
"sne-linux-x64": "0.1.0-beta.4",
|
|
36
|
+
"sne-linux-arm64": "0.1.0-beta.4"
|
|
37
|
+
}
|
|
38
|
+
}
|