csn.js
v1.1.0
Published
"A simple library to download musics from Chiasenhac.vn
Readme
CSN.JS
A library that wraps all of Chiasenhac's API.
Installation
npm i csn.js
or
yarn add csn.jsFor 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.
