Skip to content

Instantly share code, notes, and snippets.

@jchaffin
Created June 20, 2017 12:39
Show Gist options
  • Save jchaffin/9525e2d863ee138250655e5d58e6ba31 to your computer and use it in GitHub Desktop.
Save jchaffin/9525e2d863ee138250655e5d58e6ba31 to your computer and use it in GitHub Desktop.
warning user that currently node version is not designated for longterm support
let { config } = require('./config');
if (config.env === "production" && !process.release.lts) {
process.emitWarning('Running node version without lts in production', {
code: 'NO_LTS_IN_PRODUCTION',
detail: `Node.js version ${process.version} is not scheduled for long-term-support \
and may become unstable in the future.`.replace(/(\s{2,}(?!\b)|\t)/gm, '')
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment