@nodevu/core
v0.3.0
Published
nodevu core API: comprehensive node.js version tooling
Downloads
3,865
Readme
@nodevu/core
The core, online-only utility of nodevu.
Usage
const nodevu = require('@nodevu/core')
async function getData() {
const data = await nodevu() // returns a lot of data!
console.log(data)
}
getData()
API
assuming you're requiring this module as nodevu
:
nodevu(options)
- returns a promise that resolves to a giant JSON blob of data. This is the default export.options
(Object
, optional): anObject
of options to pass to the module.fetch
(Object
, optional): your chosen fetch implementation. Default: Undici's fetch impelmentation.now
(String
, optional): a custom dateString
(ISO 8601) to do relative checks against. Most likely only useful for internal testing. Default:DateTime.now()
from Luxon.urls
(Object
, optional): anObject
that enables you to set custom values for the Node.jsindex.json
file andschedule.json
file.index
(String
, optional): aString
that, if set, changes the URL that this module looks for the version index file at. This should be a full URL that points to a JSON file. Default:https://nodejs.org/dist/index.json
.schedule
(String
, optional): aString
that, if set, changes the URL that this module looks for the Node.js release schedule file at. This should be a full URL that points to a JSON file. Default:https://raw.githubusercontent.com/nodejs/Release/master/schedule.json
.
The data returned by this module follows a pretty specific structure. Here's a detailing of that structure:
- Everything is within a top level
Object
.- Every key in the
Object
is a semver major release line name with a 'v' prefix. Example:v17
. Every value is anObject
with the following properties:releases
(Object
) - anObject
that is filled with all releases under the release line:- Every key in the
Object
is a full Node.js release name. Example:v17.6.0
. Every value is anObject
with the following properties:semver
(Object
) - a smallObject
that gives semver information:raw
(String
) - the whole, raw version.major
(String
) - the semver major number.minor
(String
) - the semver minor number.patch
(String
) - the semver patch number.line
(String
) - the "name" of the release line.
releaseDate
(String
) - the version's release date.modules
(Object
)version
(String
) - the ABI (Application Binary Interface) version number of Node.js, used to determine which version of Node.js compiled C++ add-on binaries can be loaded in to without needing to be re-compiled.
dependencies
(Object
) - the bundled dependencies in this version of Node.js:npm
(String
) - version of the bundled npm.v8
(String
) - version of the bundled v8.uv
(String
) - version of the bundled libuv.zlib
(String
) - version of the bundled zlib.openssl
(String
) - version of the bundled openssl.
files
(Object
) - anObject
that provides context on the files available for the given release:available
(Array
) - the available files, as listed by the official dist file. Every entry will be a String.links
(Object
) - anObject
of the different potential links:aix
(Array
) - all AIX links (AIX is an IBM platform) links:id
(String
) - the initial identifier fromavailable
that was passed in.files
(Array
) - anArray
of associated filenames for the ID.architecture
(String
) - the name of the architecture for the files infiles
.
headers
(Array
) - all links to headers for the build:id
(String
) - the initial identifier fromavailable
that was passed in.files
(Array
) - anArray
of associated filenames for the ID.architecture
(String
) - the name of the architecture for the files infiles
.
linux
(Array
) - all the links to Linux distributions for the build:id
(String
) - the initial identifier fromavailable
that was passed in.files
(Array
) - anArray
of associated filenames for the ID.architecture
(String
) - the name of the architecture for the files infiles
.
macos
(Array
):id
(String
) - the initial identifier fromavailable
that was passed in.files
(Array
) - anArray
of associated filenames for the ID.architecture
(String
) - the name of the architecture for the files infiles
.
source
(Array
):id
(String
) - the initial identifier fromavailable
that was passed in.files
(Array
) - anArray
of associated filenames for the ID.architecture
(String
) - the name of the architecture for the files infiles
.
windows
(Array
):id
(String
) - the initial identifier fromavailable
that was passed in.files
(Array
) - AnArray
of associated filenames for the ID.architecture
(String
) - The name of the architecture for the files infiles
.
lts
(Object
):isLts
(Boolean) -true
if the release is an LTS release,false
if it's not.
security
(Object
):isSecurity
(Boolean) -true
if the release is a security release,false
if it's not.
- Every key in the
support
(Object
) - AnObject
to provide information about the project's support of the given release line, including dates, status, LTS codename, and LTS version info:codename
(String
) - Only present if applicable to the given release. AString
of the LTS release line's codename.lts
(Object
) - Only present if applicable to the given release. AnObject
that provides LTS versioning information.newest
(String
) - The newest release in the release line that is LTS. Usually, this will be the latest release in the line.oldest
(String
) - Only present if applicable to the given release. The oldest (first) release in the release line that was flagged as LTS.
phases
(Object
) - Start dates for each phase of a release line's lifecycle:start
(String
) - The start date of the release line (releases in this phase arecurrent
). Example:2021-04-20
.lts
(String
) - Only present if the release line is an LTS release. The start date of the LTS lifecycle (releases in this phase arelts
). Example:2021-10-26
.maintenance
(String
) - Only present if the release line is an LTS release. The start date of the maintenance phase of the lifecycle. Example:2022-10-18
.end
(String
) - the date the release line is no longer supported. Example:2024-04-30
.
security
(Object
):all
(Array
) - anArray
of all security releases in the release line.newest
(String
) - the newest (most recent) security release. Example:17.3.1
.
- Every key in the
Example output
You can find an example of the output here. It's big. Like, really big. GitHub will struggle to render it. It's probably worth viewing raw or curl'ing the raw output.