Catalog npm
Back to packageRELEASE DETAILS

1.1.9

npm

42.js

Library for 42 school API in js (ts)

42apijstranscendencets
Published11 Aug 2022
Direct dependencies5
Transitive dependenciesNot calculated

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.

Declared dependencies 5

Native requirements
5 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@types/axios
Environment
{
  "local_name": "@types/axios",
  "alias": false,
  "peer_metadata": null
}
^0.14.0runtime
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^18.6.3runtime
axios
Environment
{
  "local_name": "axios",
  "alias": false,
  "peer_metadata": null
}
^0.27.2runtime
bottleneck
Environment
{
  "local_name": "bottleneck",
  "alias": false,
  "peer_metadata": null
}
^2.19.5runtime
dotenv
Environment
{
  "local_name": "dotenv",
  "alias": false,
  "peer_metadata": null
}
^16.0.1runtime

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-nzTW2ayR65i3xvrBEwXpjBAc4KfaL/7AFOJRQ+OKioHM+PUKCJ69/C4tB1P3KuUte7HhxJZ2zSryC2f62r/mfA==",
  "shasum": "4ba69cbe47213fbfccd28514da86aa7ccb6a8b38",
  "tarball": "https://registry.npmjs.org/42.js/-/42.js-1.1.9.tgz",
  "fileCount": 52,
  "unpackedSize": 44834,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIQC8PYHObOsYU513YZ/nMPy1Vd00bzMHmd9aBgtcVr9MkQIgDliYHD764bB1eInTAvibvG53Ci86UoVD1MDsJc5UkRQ="
    }
  ],
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9QyRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoICg//ZtAdW9PWw3ujUMddju3go3RgcRW8S+5Ga3nYj8An/U6UtxVU\r\nn+0nkKaS4lto7rO3oW68Ifd92ZHV7/qhIEiGZ/lwd7I7lFKszPLTfywLoN1C\r\nFb+eGfoTPT122NjGhgx0O2vOiyf9PHZn86AeLY1ZoK4X5lPpMlSVd5p2yi46\r\n5LDyc9soGBzQkk0P0apyZHo+5pgX7TcJi3E/9rTnj/ckKVAy9RpAd4dcGK/Q\r\nuEz5SXtqLNd2KZnRVWmAAYSNTKTcYfjr6sciUWeNo3ZsIYYTwrQ1atsnQ44R\r\nLxqxFGmrtRjQ8zU2SsXB2Kv7Ju9fRNsr4Kn4FGF4J/LtpwFzWSIpdIZEgdYh\r\nPdnTl7mgveFd+n9rMw7xeReJrwPyWZat/7li5GUGHH+Dy7w+lC/MO6hNv/zo\r\n9r2hPtJ4QZBgsGkik6FTKP25V6mtR/0GQlkkLK6iRVjLGD5cv00P/g/FfNa6\r\nauNVu1pyGgYVUPA6ULI69uv3od4PaiHtYpZ7RhEE7skXvewPYFXfLzy3bFbc\r\n2ASHn5osG73+DUzQH/f45J6ymWmA8y3O3qzB05fOoaVYYH8eqz5/O0awzJuA\r\nOBJ5xaKdImlaKkoqemxbt4y7JDRzatvr/2NCmfZKBiPqZcaSsDxM+3aPzQLs\r\nwI1i0iQlTYGgnVDCALd7KthD55q8j8VLHMM=\r\n=huk2\r\n-----END PGP SIGNATURE-----\r\n"
}

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_version:84fab616f8e8c755d83293e37aa461f35ea7419f6e06f42123d4bb2db944bd2c

Other collected versions

1.2.622 Aug1.2.525 Jan1.2.417 Dec1.2.315 Dec1.2.23 Dec1.2.119 OctView all collected versions →