Created
June 26, 2018 15:45
-
-
Save tmcw/2f10bb67c41c5dd2cdf958a634847af7 to your computer and use it in GitHub Desktop.
This file contains 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
var fs = require('fs'); | |
var path = require('path'); | |
const packages = fs.readdirSync('./packages'); | |
const allDependencies = []; | |
fs.mkdirSync('src'); | |
for (let pkg of packages) { | |
if (pkg === 'turf') return; | |
console.log(pkg); | |
fs.unlinkSync( | |
path.join('./packages/', pkg, 'README.md')); | |
const {dependencies} = JSON.parse(fs.readFileSync( | |
path.join('./packages/', pkg, 'package.json'))); | |
fs.renameSync( | |
path.join('./packages/', pkg), | |
path.join('./src/', pkg.replace('turf-', ''))); | |
allDependencies.push(dependencies); | |
} | |
console.log(allDependencies); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment