Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: add process.release.lts property & LTS CODENAME VOTING #3212

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/api/process.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,11 @@ for the source tarball and headers-only tarball.

* `name`: a string with a value that will always be `"node"` for Node.js. For
legacy io.js releases, this will be `"io.js"`.
* `lts`: a string with a value indicating the _codename_ of the LTS (Long-term
Support) line the current release is part of. This property only exists for
LTS releases and is `undefined` for all other release types, including stable
releases. Current valid values are:
- `"WHAT WILL THIS BE?"` for the v4.x LTS line beginning with v4.2.0.
* `sourceUrl`: a complete URL pointing to a _.tar.gz_ file containing the
source of the current release.
* `headersUrl`: a complete URL pointing to a _.tar.gz_ file containing only
Expand Down
5 changes: 5 additions & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2774,6 +2774,11 @@ void SetupProcessObject(Environment* env,
READONLY_PROPERTY(process, "release", release);
READONLY_PROPERTY(release, "name", OneByteString(env->isolate(), "node"));

#if NODE_VERSION_IS_LTS
READONLY_PROPERTY(release, "lts",
OneByteString(env->isolate(), NODE_VERSION_LTS_CODENAME));
#endif

// if this is a release build and no explicit base has been set
// substitute the standard release download URL
#ifndef NODE_RELEASE_URLBASE
Expand Down
3 changes: 3 additions & 0 deletions src/node_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#define NODE_MINOR_VERSION 1
#define NODE_PATCH_VERSION 3

#define NODE_VERSION_IS_LTS 1
#define NODE_VERSION_LTS_CODENAME "Argon"

#define NODE_VERSION_IS_RELEASE 0

#ifndef NODE_STRINGIFY
Expand Down
14 changes: 14 additions & 0 deletions test/parallel/test-process-release.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const versionParts = process.versions.node.split('.');

assert.equal(process.release.name, 'node');

// it's expected that future LTS release lines will have additional
// branches in here
if (versionParts[0] === '4' && versionParts[1] >= 2) {
assert.equal(process.release.lts, 'Argon');
} else {
assert.strictEqual(process.release.lts, undefined);
}