1.1.0 • Published 1 year ago
csn.js v1.1.0
CSN.JS
A library that wraps all of Chiasenhac's API.
Installation
npm i csn.js
or
yarn add csn.js
For further documentation, please visit docs page.
Example
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();
CSNClient.on("login", async function() {
const song = await client.search.song("Shape of you");
const links = await song[0].getAudioUrl();
console.log(links);
});
CSNClient.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();
CSNClient.on("login", async function() {
const song = await client.search.song("Shape of you");
const links = await song[0].getAudioUrl();
console.log(links);
});
CSNClient.login({ email: "Your email", password: "Your password" });
License
Published with MIT license.