Catalog npm
Back to packageRELEASE DETAILS

1.1.2

npm

42.js

_Author: [shocquen](https://github.com/shocquen)_

42apijstranscendencets
Published8 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-/crUeLIGduJOGTqAOCVr1zHDrNiDP2kA/obB34CTMQGYTxmvWWpg/gxNl2cRmsSgjGJJ5PSA160xAh/EK8730g==",
  "shasum": "61f51fdda506baff672e787ed7bbec342647b874",
  "tarball": "https://registry.npmjs.org/42.js/-/42.js-1.1.2.tgz",
  "fileCount": 19,
  "unpackedSize": 18334,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQCKzOyspnVWIFCLEw6CbMBqgN/Q2YkxdoT8aOBvJbV7qAIhAMarVKoTs5iKy3JvFlCKHK6KoFFCZXiJt4dgRdpKyZkx"
    }
  ],
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8aEsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpfpw//TDMzutJqrAl1b6TCtMuc/u1A7oKVWeQClQVhYSh8Ziu28w2d\r\nxKEZi1piERKJR46Uc1Mgbz59d13zPOR9AnJ/xiN10geX7n/4sZcwLjjmpsXx\r\npHzyrtsI8P3A8T7oOsGpmN0xrsjXzIaM8UDj1VB/w5UX9vFNT0arAYUnDat2\r\n4EBsHab0zhjIHm+mm6m2BJX3f9HuBaP14bk/iXP1X5zzepemRJ+AOO3no69u\r\n/6GB5IjLB+f7Fdxvb2O2rmIRzVTdJJnAOPeaVS6ox9gBEzlssjkcXCxW5ilm\r\ndNk2W/EaiJu9nucRNg7nER56Ok/1AmmAfoC0fboZr6FOpnonQ9JHQ0kAL7TM\r\nOGvyQdE0gOvGXsnQS+eTizXgtMtfrUWV1w2RnYyVmtkhhh0uYHUxvWfqIYDt\r\npOpQxbM4xs8egdP88xljPbuupOPgFXf7mqeTUW483WwPtTm5WpUDly4cR2co\r\nXahbzH2Bwk2rwf/79JluSW5T17gEio77A9h2dUGZSA2GVcSMcqTOZR0joWLX\r\nosxjef563UsBgbgz+KoGTMWp/GcIO6lvJ0qp+l+CYQ5dRi7GFDoRVscu46L6\r\nx+lQcZszLadK1tSSjeAvBx33jGUL8Gbr9mlC0bczWRSDaHyr1Rjp++dbHWAy\r\nz0xSuGz77AvhshmaPvGk1cKTS8Q+lgCiI6o=\r\n=7o6p\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:88b8ecfd3a98cd9e54ee5c96f9d8995acc632d3bd5f4d85d6348605fcc2ecf45

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 →