Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-version

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-version - npm Package Compare versions

Comparing version 0.1.0 to 1.0.0

Makefile

19

index.js

@@ -1,1 +0,18 @@

module.exports = require('./lib/node-version');
module.exports = (function() {
var version = process.version;
if (version.indexOf('v') > -1) {
version = version.split('v')[1];
}
var split = version.split('.');
return {
original: process.version,
short: split[0] + '.' + split[1],
long: split[0] + '.' + split[1] + '.' + split[2],
major: split[0],
minor: split[1],
build: split[2]
};
})();

38

package.json
{
"name": "node-version",
"version": "0.1.0",
"description": "Get NodeJS current version",
"homepage": "https://github.com/srod/node-version",
"author": {
"name": "Rodolphe Stoclin",
"email": "rodolphe@2clics.net",
"url": "http://2clics.net"
},
"main": "index",
"repository": {
"type": "git",
"url": "https://github.com/srod/node-version.git"
},
"keywords": ["version"]
"name": "node-version",
"version": "1.0.0",
"description": "Get NodeJS current version",
"homepage": "https://github.com/srod/node-version",
"author": {
"name": "Rodolphe Stoclin",
"email": "rodolphe@2clics.net",
"url": "http://2clics.net"
},
"main": "./index.js",
"repository": {
"type": "git",
"url": "https://github.com/srod/node-version.git"
},
"keywords": [
"version"
],
"devDependencies": {
"semver": "^5.0.1"
}
}

@@ -0,28 +1,48 @@

[![Dependency Status](http://img.shields.io/david/srod/node-version.svg?style=flat)](https://david-dm.org/srod/node-version)
[![devDependency Status](http://img.shields.io/david/dev/srod/node-version.svg?style=flat)](https://david-dm.org/srod/node-version#info=devDependencies)
[![NPM version](http://img.shields.io/npm/v/node-version.svg?style=flat)](https://www.npmjs.org/package/node-version)
# Node-version
A quick module that returns current node version.
See server.js in examples/
A quick module that returns current node version parsed into parts.
## Installation
npm install node-version
```shell
npm install node-version
```
## Quick Start
var nodeVersion = new (require('../lib/node-version').version);
var currentVersion = nodeVersion.getVersion();
```js
var currentVersion = require('node-version');
/*
console.log(currentVersion);
/*
console.log(currentVersion);
{
original: 'v0.4.10', // same as process.version
short: '0.4',
long: '0.4.10',
major: '0',
minor: '4',
build: '10'
}
*/
{
original: 'v0.4.10', // same as process.version
short: '0.4',
long: '0.4.10',
major: '0',
minor: '4',
build: '10'
}
*/
```
## Warning
Version 1.0.0 break 0.1.0 since its API changes.
Change
```js
var currentVersion = new (require('../lib/node-version').version);
```
To
```js
var currentVersion = require('node-version');
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc