gb-opcodes
Advanced tools
Comparing version 1.0.1 to 2.0.0
23
index.js
@@ -53,3 +53,2 @@ 'use strict'; | ||
const URL = 'http://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html'; | ||
const FILE_OUT = './opcodes.json'; | ||
@@ -64,16 +63,14 @@ request(URL, function (err, response, body) { | ||
const $ = cheerio.load(body); | ||
const tables = $('table').slice(0, 2); | ||
const tables = $('table').splice(0, 2); | ||
const insts = { | ||
unprefixed: parseTable($, tables[0]), | ||
cbprefixed: parseTable($, tables[1]) | ||
}; | ||
const data = [ | ||
'unprefixed', | ||
'cbprefixed' | ||
] | ||
.reduce((p, c, i) => { | ||
p[c] = parseTable($, tables[i]); | ||
return p; | ||
}, {}); | ||
fs.writeFile(FILE_OUT, JSON.stringify(insts, null, 4), (err) => { | ||
if (err) { | ||
console.error(`Unable to write file on ${FILE_OUT}`, err); | ||
process.exit(1); | ||
} | ||
console.info(`Opcodes written on ${FILE_OUT}`); | ||
}); | ||
process.stdout.write(JSON.stringify(data, null, 4)); | ||
}); |
{ | ||
"name": "gb-opcodes", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "generate gameboy opcodes table in JSON format", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,5 +7,6 @@ # gb-opcodes | ||
`$ npm i && npm start` | ||
`$ npm start` | ||
Opcodes will output in the file `opcodes.json` also included on the [repo](https://github.com/dmacosta/gb-opcodes/blob/master/opcodes.json). | ||
Program output is on the [opcodes.json](https://github.com/dmacosta/gb-opcodes/blob/master/opcodes.json) | ||
file included on this repo. | ||
@@ -12,0 +13,0 @@ ## References |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18
158967
7369