Created
September 3, 2019 17:19
-
-
Save zleight1/8cd2471e4bcb40ce8763f018fd0ed277 to your computer and use it in GitHub Desktop.
Package-lock.json Node fix file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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