Skip to content

Instantly share code, notes, and snippets.

@zleight1
Created September 3, 2019 17:19
Show Gist options
  • Save zleight1/8cd2471e4bcb40ce8763f018fd0ed277 to your computer and use it in GitHub Desktop.
Save zleight1/8cd2471e4bcb40ce8763f018fd0ed277 to your computer and use it in GitHub Desktop.
Package-lock.json Node fix file
'use strict';
const fs = require('fs');
const packageLockFile = 'package-lock.json';
fs.readFile(packageLockFile, 'utf8', (err, data) => {
if (err) {
return console.log(err);
}
const result = data.replace(/http:\/\//g, 'https://');
fs.writeFile(packageLockFile, result, 'utf8', err => {
if (err) return console.log(err);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment