Catalog npm
PACKAGE EXPLORERView in registry

42.js

npm

Library for 42 school API in js (ts)

42apijstranscendencets
Versions collected19
Direct dependencies7From release 1.2.6
Last observed20 Oct, 19:59 UTC

README

Current package documentation

42.js

Library for 42 school API. In progress...

Author: shocquen

npm npm npm

Installation

npm install 42.js

Quick start

import "dotenv/config";
import { Client } from "42.js";

(async () => {
	const client = new Client(
		<string>process.env.CLIENT_ID,
		<string>process.env.CLIENT_SECRET
	);

	try {
		if (process.argv.length != 3) throw "Bad arguments! Give me a login !";
		const login = process.argv[2];

		const user = await client.users.get(login);
		console.log(user?.displayname);
		const auth_process = await client.auth_manager.init_auth_process(
			"http://localhost:3333/callback",
			["public", "projects", "profile"],
			{
				port: 3333,
				callback_function: async (user) => {
					if (auth_process)
						client.auth_manager.stop_auth_process(auth_process.id);
					//const teams = await user.get("/me/teams");
					//console.log(teams?.data[0]);
				},
			}
		);
		if (auth_process) console.log(auth_process.url);
	} catch (err) {
		console.error(err);
	}
})();

Contributing

Pull requests are welcome. Don't hesitate to contact me by discord Saky#0001 or directly at school if we met

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 19

Collected releases
VersionPublishedDirect dependenciesOpen version
1.2.6Registry latest22 Aug 20237
1.2.525 Jan 20237
1.2.417 Dec 20227
1.2.315 Dec 20227
1.2.23 Dec 20227
1.2.119 Oct 20227
1.2.09 Oct 20227
1.1.1212 Aug 20225
1.1.1111 Aug 20225
1.1.911 Aug 20225
1.1.810 Aug 20225
1.1.79 Aug 20225
1.1.69 Aug 20225
1.1.59 Aug 20225
1.1.49 Aug 20225
1.1.39 Aug 20225
1.1.28 Aug 20225
1.1.18 Aug 20225
1.1.08 Aug 20225

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
shocquen/42.js

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:59 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:7a375e5d22e8283d8f2d11dea1529d43b1f9a8f7509145808a53ad7fba915eb8