diff --git a/examples/cmd-line-parse/Readme.md b/examples/cmd-line-parse/Readme.md index 5eaeb7e..4d085ef 100644 --- a/examples/cmd-line-parse/Readme.md +++ b/examples/cmd-line-parse/Readme.md @@ -3,6 +3,6 @@ mp3Parser example: Cmd line parse Parses given mp3 file, invoking `mp3Parser.readTags` / `mp3Parser.readLastFrame` to output information about ID3v2 or Xing/Lame tags as well as the last mp3 frame found. Run with -`node parse.js `. +`node parse.js ` after `npm install`ing. In this example, mp3Parser is loaded as a CommonJS module. diff --git a/examples/cmd-line-parse/package.json b/examples/cmd-line-parse/package.json new file mode 100644 index 0000000..f6d6386 --- /dev/null +++ b/examples/cmd-line-parse/package.json @@ -0,0 +1,19 @@ +{ + "name": "mp3-parser-example-cmd-line-parse", + "version": "0.0.1", + "description": "Parse given mp3 file to output ID3v2 or Xing/Lame and last frame found.", + "keywords": [ + "mp3", + "id3" + ], + "bugs": "https://github.com/biril/mp3-parser/issues", + "license": "MIT", + "author": "biril ", + "private": true, + "dependencies": { + "mp3-parser": "^0.2.6" + }, + "engines": { + "node": ">=4.0.0" + } +} diff --git a/examples/cmd-line-parse/parse.js b/examples/cmd-line-parse/parse.js index 477ff63..aa02b7d 100755 --- a/examples/cmd-line-parse/parse.js +++ b/examples/cmd-line-parse/parse.js @@ -3,7 +3,8 @@ const fs = require("fs"); const util = require("util"); -const mp3Parser = require(__dirname + "/../../main"); +const mp3Parser = require("mp3-parser"); + const pathToMp3 = process.argv[2]; const toArrayBuffer = buffer => { const bufferLength = buffer.length;