{"id":17673641,"url":"https://github.com/codetheweb/librespot-node","last_synced_at":"2025-08-05T10:07:05.474Z","repository":{"id":85614021,"uuid":"307516151","full_name":"codetheweb/librespot-node","owner":"codetheweb","description":null,"archived":false,"fork":false,"pushed_at":"2020-10-26T22:11:07.000Z","size":38,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-18T21:20:04.298Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codetheweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-26T22:05:37.000Z","updated_at":"2025-03-26T23:13:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"dd243d87-af5f-46c5-9262-b8f6eda1c475","html_url":"https://github.com/codetheweb/librespot-node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codetheweb/librespot-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codetheweb%2Flibrespot-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codetheweb%2Flibrespot-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codetheweb%2Flibrespot-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codetheweb%2Flibrespot-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codetheweb","download_url":"https://codeload.github.com/codetheweb/librespot-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codetheweb%2Flibrespot-node/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268875041,"owners_count":24321694,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-05T02:00:12.334Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-24T05:42:42.740Z","updated_at":"2025-08-05T10:07:05.424Z","avatar_url":"https://github.com/codetheweb.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# librespot-node\n\nAn easy to use Node.js wrapper for [librespot](https://github.com/librespot-org/librespot), an open source Spotify client, based on [neon](https://github.com/neon-bindings/neon)\n\n## Building\n1. Clone this repo\n2. run `npm install` inside the root folder\n3. Once everything is installed, run `npx neon build` to start building the native module\n4. Build Typescript code with `npm run build` / `npm run watch`\n\n## Basic Examples\n\n### Playing a song\n```js\nconst { Spotify } = require('../native');\nconst spotify = new Spotify('\u003cusername\u003e', '\u003cpassword\u003e');\n\n// Load specified track (by id) and starts playing\nspotify.play('\u003ctrack-id\u003e');\n\nsetInterval(() =\u003e {\n    console.log('playing? ', spotify.isPlaying());\n}, 1000);\n```\n\n### Getting web token (can be used for retrieving metadata)\n```js\nconst { Spotify } = require('../native');\nconst spotify = new Spotify('\u003cusername\u003e', '\u003cpassword\u003e');\n\nspotify.getToken('\u003cspotify-client-id\u003e', '\u003cscopes\u003e', (token) =\u003e {\n    console.log(token.getToken(), token.getExpiry(), token.getScope());\n});\n```\n\n## API (Work in progress)\n\n```ts\ninterface Spotify {\n    constructor({\n        username: string,\n        password: string,\n        quality?: enum\n        cacheDir?: string, \n        connect {\n            type: enum,\n            name: string\n        }\n    })\n    play(trackId: string);\n    stop();\n    pause();\n    seek(positionMs: number) throws;\n    getPosition(): throws number\n    getTrack(): throws string\n    isPlaying(): boolean;\n    emit: started, stopped, loading, playing, paused, endoftrack, volumeset\n}\n\nget current volume\n\ninterface AccessToken {\n    getToken(): string;\n    getExpiry(): number;\n    getScope(): string[];\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodetheweb%2Flibrespot-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodetheweb%2Flibrespot-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodetheweb%2Flibrespot-node/lists"}