
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
@particle/device-os-version-checks
Advanced tools
@particle/device-os-version-checksVersion checking utilities for Device OS
npm install @particle/device-os-version-checks --save
booleanbooleanbooleanbooleanbooleanbooleanstringbooleanDetermines if given Device OS version is considered obsolete based on a list of available versions.
Summary of rules: if you're on LTS, you should be on the latest major version. if you're on an RC (prerelease), it should be newer than any non-RC or LTS release and you should be on the latest RC available. if you are on a normal release (non-RC, non-LTS), you should be on the latest major and no more than 2 minor releases behind. if you're on something older than v1.4.4, you should update. otherwise, you're good!
Kind: static method of @particle/device-os-version-checks
Returns: boolean - Whether or not the given version is considered obsolete.
| Param | Type | Description |
|---|---|---|
| target | string | object | Semver-compaitble version string or an object with a similarly formatted version field. |
| allFirmware | string | array | The list of firmware versions (either strings or objects) to check against. NOTE: MUST BE SORTED IN DESCENDING ORDER |
Example
const version = '1.0.0';
const dependency = { version };
const allFirmware = [
{ version: '1.0.0' },
{ version: '0.9.0' },
{ version: '0.8.0' },
{ version: '0.7.0' }
];
if (isObsoleteFirmware(version || dependency, allFirmware)){
console.warn('...');
}
booleanDetermines if given Device OS version is an LTS (long-term support) line.
Kind: static method of @particle/device-os-version-checks
Returns: boolean - Whether or not the given version is an LTS line.
| Param | Type | Description |
|---|---|---|
| target | string | object | Semver-compaitble version string or an object with a similarly formatted version field. |
Example
const version = '4.0.0';
const dependency = { version };
if (isLTSVersion(version || dependency)){
console.log('LTS!');
}
booleanDetermines if given Device OS version is a standard (non-LTS, non-rc) line.
Kind: static method of @particle/device-os-version-checks
Returns: boolean - Whether or not the given version is a standard (non-LTS, non-rc) line.
| Param | Type | Description |
|---|---|---|
| target | string | object | Semver-compaitble version string or an object with a similarly formatted version field. |
Example
const version = '1.0.0';
const dependency = { version };
if (isReleaseVersion(version || dependency)){
console.log('standard release line');
}
booleanDetermines if given Device OS version is a pre-release (rc).
Kind: static method of @particle/device-os-version-checks
Returns: boolean - Whether or not the given version is a pre-release (rc).
| Param | Type | Description |
|---|---|---|
| target | string | object | Semver-compaitble version string or an object with a similarly formatted version field. |
Example
const version = '1.0.0-rc.1';
const dependency = { version };
if (isPreReleaseVersion(version || dependency)){
console.log('RC!');
}
booleanDetermines if given Device OS version is source (e.g. deviceOS@source).
Kind: static method of @particle/device-os-version-checks
Returns: boolean - Whether or not the given version is source (e.g. deviceOS@source).
| Param | Type | Description |
|---|---|---|
| target | string | object | Semver-compaitble version string or an object with a similarly formatted version field. |
Example
const version = 'source';
if (isSourceVersion(version)){
console.log('working from source!');
}
booleanDetermines if given Device OS version is experimental.
Kind: static method of @particle/device-os-version-checks
Returns: boolean - Whether or not the given version is experimental.
| Param | Type | Description |
|---|---|---|
| target | object | FirmwareDependency with status property. |
stringReturns greater of two targets' semver-compaitble version string.
Kind: static method of @particle/device-os-version-checks
Returns: string - The greater version amongst a and b.
| Param | Type | Description |
|---|---|---|
| a | string | object | Semver-compaitble version string or an object with a similarly formatted version field. |
| b | string | object | Semver-compaitble version string or an object with a similarly formatted version field. |
Example
const a = '0.6.0';
const b = { version: '0.8.5' };
const latest = pickLatestVersion(a, b);
console.log(latest); // 0.8.5;
NOTE: Unfortunately, docs have a nasty habit of falling out of date. When in doubt, check usage in tests
FAQs
Version checking utilities for Device OS
We found that @particle/device-os-version-checks demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 23 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.