Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

NPM enforces the field for "engines" in package.json at install time,…

… so there should not be any need for boilerplate code for checking the version of node.
  • Loading branch information...
commit 63dcc87b5c3dfb82f82d73191fa3a074b29d8d63 1 parent 5ebf7ee
@tedeh tedeh authored
Showing with 2 additions and 32 deletions.
  1. +2 −32 lib/ya-csv.js
View
34 lib/ya-csv.js
@@ -1,9 +1,5 @@
-var sys = require('sys');
-
-var REQUIRED_NODE_VERSION = '0.1.99';
-_checkVersionNumber();
-
-var events = require('events'),
+var sys = require('sys'),
+ events = require('events'),
fs = require('fs');
var csv = exports;
@@ -268,29 +264,3 @@ function _setOptions(obj, options) {
obj.columnsFromHeader = options.columnsFromHeader || false;
obj.nestedQuotes = options.nestedQuotes || false;
};
-
-function _checkVersionNumber() {
- var supported = (function() {
- if (!process.version) return false;
- function version2fields(v) {
- var fields = v.split('.');
- return [ parseInt(fields[0]), parseInt(fields[1]), parseInt(fields[2]) ];
- }
- var r = version2fields(REQUIRED_NODE_VERSION);
- var a = version2fields(process.version.replace(/^v/, ''));
- if (a[0] > r[0]) {
- return true;
- } else if (a[0] === r[0]) {
- if (a[1] > r[1]) {
- return true;
- } else if (a[1] === r[1]) {
- if (a[2] >= r[2]) return true;
- }
- }
- return false;
- })();
- if (! supported) {
- sys.debug("Unsupported Node.js version: expected "
- + REQUIRED_NODE_VERSION + " or higher, got " + process.version);
- }
-};
Please sign in to comment.
Something went wrong with that request. Please try again.