@libyears/cli 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 +110 -0
  3. package/dist/bin.js +11668 -0
  4. package/package.json +51 -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,110 @@
1
+ # @libyears/cli
2
+
3
+ How far behind are your dependencies?
4
+
5
+ ```bash
6
+ npx @libyears/cli
7
+ ```
8
+
9
+ ```
10
+ /Users/you/project pnpm lockfile v9.0
11
+
12
+ PACKAGE INSTALLED LATEST BEHIND LIBYEARS
13
+ typescript 5.9.3 7.0.2 2 major 0.77
14
+ @types/node 20.19.43 26.2.0 6 major 0.16
15
+ eslint 9.39.5 10.9.0 1 major 0.11 deprecated
16
+
17
+ 1.0 libyears behind · 34 direct, 683 transitive · 3 a major behind · 14 current
18
+ 7 private packages counted but never sent to the registry
19
+ ```
20
+
21
+ No account, no sign-up, no configuration. Reads your lockfile, asks the npm
22
+ registry when each version was published, and tells you how much release time
23
+ you are behind.
24
+
25
+ ## What a libyear is
26
+
27
+ One libyear is one year of release time between what you have installed and
28
+ the latest stable version. A package you upgraded last week contributes almost
29
+ nothing; one you pinned in 2019 contributes six. Summed across a project it is
30
+ a single number for "how far behind are we", and unlike a count of outdated
31
+ packages it does not treat a patch release the same as five years of drift.
32
+
33
+ The idea is [Jared Beck's](https://libyear.com). This adds versions behind,
34
+ deprecation and removed-from-registry detection, and every lockfile format.
35
+
36
+ ## Privacy
37
+
38
+ Private package names never leave your machine. Anything published to a
39
+ private registry, resolved from a scope with its own registry, or defined
40
+ inside your own workspace is counted and never named to anyone. Credentials in
41
+ `.npmrc`, `.yarnrc.yml` and `bunfig.toml` are discarded before parsing and are
42
+ never stored or logged.
43
+
44
+ Nothing is uploaded at all unless you pass `--push`.
45
+
46
+ ## Supported lockfiles
47
+
48
+ `pnpm-lock.yaml` (5.4, 6.0, 9.0 and pnpm 11 multi-document), `package-lock.json`
49
+ (v1, v2, v3), `yarn.lock` (classic and Berry), and `bun.lock` (v0 to v3).
50
+ Handles `npm:` aliases, catalogs, overrides, peer suffixes and workspace
51
+ protocols. With no lockfile it falls back to declared ranges and says so.
52
+
53
+ ## In continuous integration
54
+
55
+ ```bash
56
+ npx @libyears/cli --max-libyears 10 --max-majors 2
57
+ ```
58
+
59
+ Exit codes are the contract:
60
+
61
+ | Code | Meaning |
62
+ |---|---|
63
+ | 0 | scanned, and within any thresholds given |
64
+ | 1 | a threshold was exceeded, or a `--push` was rejected |
65
+ | 2 | the command could not run: bad arguments, no `package.json` |
66
+
67
+ `1` and `2` are kept apart deliberately. A pipeline that treats them the same
68
+ passes silently the day the scan itself breaks.
69
+
70
+ ## Options
71
+
72
+ ```
73
+ --json machine-readable output
74
+ --offline skip the registry: inventory only, no freshness
75
+ --limit <n> rows to print before summarising (default 25)
76
+ --concurrency <n> parallel registry requests (default 8)
77
+
78
+ --max-libyears <n> exit 1 if the total exceeds n
79
+ --max-majors <n> exit 1 if any direct dependency is more than n majors behind
80
+
81
+ --push upload this snapshot to a hosted ledger
82
+ --token <t> project token (or set LIBYEARS_TOKEN)
83
+ --api <url> override the endpoint (or set LIBYEARS_API)
84
+ ```
85
+
86
+ `NO_COLOR` and `FORCE_COLOR` are honoured. Output piped to a file carries no
87
+ escape sequences.
88
+
89
+ ## Why "latest" can differ from `npm outdated`
90
+
91
+ A release published in the last fourteen days does not count as lag yet. You
92
+ have not fallen behind because someone published this morning. The genuinely
93
+ newest version is still reported in the summary line, so the difference is
94
+ visible rather than mysterious.
95
+
96
+ ## Pushing to a hosted ledger
97
+
98
+ `--push` sends the inventory — package names, versions and dependency types —
99
+ to [libyears.com](https://libyears.com), where it joins the same ledger a
100
+ GitHub App installation would produce. No source code, no file contents, no
101
+ lockfile, and no private package names. It is the ingestion path for GitLab,
102
+ Bitbucket and self-hosted repositories.
103
+
104
+ The hosted product is a separate, proprietary application. This CLI, the
105
+ lockfile parsers and the freshness metrics are MIT and work entirely without
106
+ it.
107
+
108
+ ## Licence
109
+
110
+ MIT.