Created
December 8, 2015 16:15
-
-
Save igorshubovych/bf43e15424fff5420afd to your computer and use it in GitHub Desktop.
Short index for TLDR project
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
{ | |
"commands": [ | |
{ | |
"name": "ab", | |
"platform": [ | |
"common" | |
] | |
}, | |
{ | |
"name": "ack", | |
"platform": [ | |
"common" | |
] | |
}, | |
{ | |
"name": "ag", | |
"platform": [ | |
"common" | |
] | |
}, | |
{ | |
"name": "airport", | |
"platform": [ | |
"osx" | |
] | |
}, | |
{ | |
"name": "alias", | |
"platform": [ | |
"common" | |
] | |
}, | |
{ | |
"name": "apropos", | |
"platform": [ | |
"common" | |
] | |
}, | |
{ | |
"name": "apt-get", | |
"platform": [ | |
"linux" | |
] | |
}, | |
{ | |
"name": "aptitude", | |
"platform": [ | |
"linux" | |
] | |
} | |
] | |
} |
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
{ | |
"ab": [ | |
"common" | |
], | |
"ack": [ | |
"common" | |
], | |
"ag": [ | |
"common" | |
], | |
"airport": [ | |
"osx" | |
], | |
"alias": [ | |
"common" | |
], | |
"apropos": [ | |
"common" | |
], | |
"apt-get": [ | |
"linux" | |
], | |
"aptitude": [ | |
"linux" | |
] | |
} |
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
var _ = require('lodash'); | |
var fs = require('fs'); | |
var indexContent = fs.readFileSync('assets/index.json'); | |
var index = JSON.parse(indexContent).commands; | |
var shortIndex = _.zipObject( | |
_.map(index, 'name'), | |
_.map(index, 'platform')); | |
console.log(JSON.stringify(shortIndex)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment