A library that wraps all of Chiasenhac's API.
npm i csn.js
or
yarn add csn.js
For further documentation, please visit docs page.
For more examples, visit here
CommonJS (no account):
(async() => {
const csnjs = require("csn.js");
const client = new csnjs.Client();
const song = await client.search.song("Shape of you");
const links = await song[0].getAudioUrl();
console.log(links);
})();
CommonJS (with account):
const csnjs = require("csn.js");
const client = new csnjs.Client();
client.on("login", async function() {
const song = await client.search.song("Shape of you");
const links = await song[0].getAudioUrl();
console.log(links);
});
client.login({ email: "Your email", password: "Your password" });
Typescript/ESM/ES (no account):
import * as csnjs from "csn.js";
(async() => {
const client = new csnjs.Client();
const song = await client.search.song("Shape of you");
const links = await song[0].getAudioUrl();
console.log(links);
})();
Typescript/ESM/ES (with account):
import * as csnjs from "csn.js";
const client = new csnjs.Client();
client.on("login", async function() {
const song = await client.search.song("Shape of you");
const links = await song[0].getAudioUrl();
console.log(links);
});
client.login({ email: "Your email", password: "Your password" });
Published with MIT license.