Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icecast-metadata-stats NodeJS support #182

Closed
lawesw opened this issue Aug 9, 2023 · 6 comments · Fixed by #189
Closed

icecast-metadata-stats NodeJS support #182

lawesw opened this issue Aug 9, 2023 · 6 comments · Fixed by #189
Labels
enhancement New feature or request

Comments

@lawesw
Copy link

lawesw commented Aug 9, 2023

Hello!

I'm fairly new to JavaScript and I've having trouble getting icecast-metadata-js to work at all. I keep getting an error saying the module cant be found.

Error: Cannot find module 'icecast-metadata-stats'
Require stack:
- /Users/**username**/Downloads/metadata/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (/Users/**username**/Downloads/metadata/index.js:1:30)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/Users/**username**/Downloads/metadata/index.js' ]
}

Even after after I have installed all the icecast-metadata packages?

CleanShot 2023-08-09 at 19 20 14@2x

Below is the code inside index.js

const IcecastMetadataStats = require('icecast-metadata-stats')

const statsListener = new IcecastMetadataStats(
  "https://dsmrad.io/stream/isics-all", {
    sources: ["icy"],
    onStats: (stats) => { console.log(stats.icy) }
  }
@eshaz
Copy link
Owner

eshaz commented Aug 9, 2023

What does your package.json file look like? Can you share a link to your code on github?

@lawesw
Copy link
Author

lawesw commented Aug 10, 2023

 "name": "metadata",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "icecast-metadata-js": "^1.2.7",
    "icecast-metadata-player": "^1.16.5",
    "icecast-metadata-stats": "^0.1.10"
  }
}

@eshaz
Copy link
Owner

eshaz commented Aug 10, 2023

icecast-metadata-stats is meant to be used in the browser only, but you can put in a feature request here if you want to use it in NodeJS. It will take me some time to implement that though.

What are you trying to do with the library?

@lawesw
Copy link
Author

lawesw commented Aug 10, 2023

Thanks! I'm trying to make a Node.js application that tracks song metadata of radio stations.

@eshaz eshaz changed the title Unable to get icecast-metadata-js working at all icecast-metadata-stats NodeJS support Aug 12, 2023
@eshaz eshaz added the enhancement New feature or request label Aug 12, 2023
@kdev
Copy link

kdev commented Oct 20, 2023

any updates on implementing this for node.js?

@eshaz
Copy link
Owner

eshaz commented Oct 21, 2023

@kdev, I've just released icecast-metadata-stats/0.1.11 that enables NodeJS support. Let me know if you run into any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants