knex/knex.js

29 lines
804 B
JavaScript
Raw Normal View History

const { isNode6 } = require('./lib/util/version-helper');
2015-05-02 13:14:32 -04:00
// Knex.js
// --------------
2016-08-09 13:33:47 -04:00
// (c) 2013-present Tim Griesser
// Knex may be freely distributed under the MIT license.
// For details and documentation:
// http://knexjs.org
// Should be safe to remove after support for Node.js 6 is dropped
if (isNode6()) {
try {
const oldPromise = global.Promise;
2018-12-16 12:07:36 -06:00
require('@babel/polyfill');
// Preserve any Promise overrides set globally prior to importing knex
if (oldPromise) {
global.Promise = oldPromise;
}
} catch (e) {
throw new Error(
`You are using Node.js 6. Please consider upgrading to Node.js 8+ or add '@babel/polyfill' dependency to the project (knex will automatically load it).`
);
2018-12-16 12:07:36 -06:00
}
}
module.exports = require('./lib/index');