I grabbed the eco.pgn for pgn-extract and ran it through pgn-parser to generate a lookup table of fen string => opening name, for fast lookup in PGN viewer programs.
const eco = require('chess-eco-codes');
const data = eco('rnbqkbnr/pppppppp/8/8/6P1/8/PPPPPP1P/RNBQKBNR b KQkq g3 0 1');
console.log(data);
The result from the console log above would be
{
"code": "A00",
"name": "Grob's Attack",
"moves": "1. g4"
}
npm install
npm test