libyears 0.1.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +14 -0
  3. package/bin.js +30 -0
  4. package/package.json +37 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Selvakumar Arumugam
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,14 @@
1
+ # libyears
2
+
3
+ ```bash
4
+ npx libyears
5
+ ```
6
+
7
+ The same thing as `npx @libyears/cli`, under the shorter name. It prints how
8
+ many versions and libyears behind your dependencies are, offline, without
9
+ sending anything anywhere, and can push a snapshot to the hosted ledger at
10
+ [libyears.com](https://libyears.com) with a project token.
11
+
12
+ Options, output and exit codes are documented in
13
+ [@libyears/cli](https://www.npmjs.com/package/@libyears/cli). This package
14
+ carries no code of its own beyond finding that binary.
package/bin.js ADDED
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ // `npx libyears` is `npx @libyears/cli`. This file finds the real binary
3
+ // beside itself and hands over; every option, exit code and byte of output
4
+ // is the CLI's own.
5
+ //
6
+ // Found by path rather than imported by name: the CLI's package exports do
7
+ // not list its binary, and a bin file is not something a package should
8
+ // have to export. Both layouts npm and npx produce put the dependency in a
9
+ // node_modules directory above this file.
10
+ import { existsSync } from 'node:fs';
11
+ import { dirname, join } from 'node:path';
12
+ import { fileURLToPath, pathToFileURL } from 'node:url';
13
+
14
+ const target = join('@libyears', 'cli', 'dist', 'bin.js');
15
+ let dir = dirname(fileURLToPath(import.meta.url));
16
+ let found;
17
+ for (let i = 0; i < 8 && !found; i++) {
18
+ const candidate = join(dir, 'node_modules', target);
19
+ if (existsSync(candidate)) found = candidate;
20
+ const parent = dirname(dir);
21
+ if (parent === dir) break;
22
+ dir = parent;
23
+ }
24
+
25
+ if (!found) {
26
+ console.error('libyears: could not find @libyears/cli. Try `npx @libyears/cli` directly.');
27
+ process.exit(1);
28
+ }
29
+
30
+ await import(pathToFileURL(found).href);
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "libyears",
3
+ "version": "0.1.0",
4
+ "description": "How far behind are your dependencies? Alias for @libyears/cli.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "libyears": "bin.js"
9
+ },
10
+ "files": [
11
+ "bin.js",
12
+ "LICENSE",
13
+ "README.md"
14
+ ],
15
+ "engines": {
16
+ "node": ">=20"
17
+ },
18
+ "dependencies": {
19
+ "@libyears/cli": "^0.1.0"
20
+ },
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/priyalstech/libyears.git",
24
+ "directory": "packages/libyears"
25
+ },
26
+ "homepage": "https://libyears.com",
27
+ "keywords": [
28
+ "dependencies",
29
+ "libyear",
30
+ "npm",
31
+ "lockfile",
32
+ "technical-debt"
33
+ ],
34
+ "scripts": {
35
+ "test": "node --test \"test/**/*.test.mjs\""
36
+ }
37
+ }