Skip to content

Commit

Permalink
chore: Drop support for Node < 8
Browse files Browse the repository at this point in the history
  • Loading branch information
ExE-Boss committed Mar 2, 2019
1 parent 66214d4 commit f9b16d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: node_js
node_js:
- '6'
- '8'
- '10'
- 'node'
Expand Down
9 changes: 2 additions & 7 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const header = require('gulp-header');
const concat = require('gulp-concat');
const replace = require('gulp-replace');
const pump = require('pump');
const util = require('util');
const fs = require('fs');

const paths = {
Expand Down Expand Up @@ -77,16 +78,10 @@ function build(cb) {
`), concat('prism.js'), dest('./')], cb);
}

/**
* @return {Promise<void>}
*/
async function componentsJsonToJs() {
const data = await componentsPromise;
const js = `var components = ${JSON.stringify(data)};\nif (typeof module !== 'undefined' && module.exports) { module.exports = components; }`;
// Node's `util.promisify()` requires Node 8+
return new Promise((resolve, reject) => {
fs.writeFile(paths.componentsFileJS, js, err => err ? reject(err) : resolve());
});
return util.promisify(fs.writeFile)(paths.componentsFileJS, js);
}

function watchComponentsAndPlugins() {
Expand Down

0 comments on commit f9b16d3

Please sign in to comment.