Skip to content

Instantly share code, notes, and snippets.

@mpmckenna8
Created July 3, 2014 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpmckenna8/fcc1461cf577a9e048ef to your computer and use it in GitHub Desktop.
Save mpmckenna8/fcc1461cf577a9e048ef to your computer and use it in GitHub Desktop.
Turf Module counter

This is a simple script which will need node installed to run and will also need you to npm install turf. My node_modules folder is not hidden as it will be if you don't create one before npm install. Not sure if that will affect fs stuff.

To run the script from the command line: ' node turfCount.js '

And now you should know how many turf modules there are! 51 when I last checked.

var fs = require('fs');
var turfdata = fs.readFileSync('node_modules/turf/package.json', 'utf-8');
var geoobj = JSON.parse(turfdata);
var turfDe = geoobj.dependencies;
var keys = Object.keys(turfDe);
//console.log(geoobj);
// console.log(turfDe)
console.log(keys.length)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment