Skip to content
This repository has been archived by the owner on Oct 27, 2023. It is now read-only.
/ csn.js Public archive

An unofficial library that wraps all of Chiasenhac's API.

License

Notifications You must be signed in to change notification settings

CookieGMVN/csn.js

Repository files navigation

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();

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" });

License

Published with MIT license.