Catalog npm
Back to packageRELEASE DETAILS

1.2.5

npm

42.js

Library for 42 school API in js (ts)

42apijstranscendencets
Published25 Jan 2023
Direct dependencies7
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 7

Native requirements
7 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
express
Environment
{
  "local_name": "express",
  "alias": false,
  "peer_metadata": null
}
^4.18.2runtime
@types/express
Environment
{
  "local_name": "@types/express",
  "alias": false,
  "peer_metadata": null
}
^4.17.14development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-m5ELyFQMHDx9mvYLfS8oF1EB5O3VUQnVsKLhHC7xzDcByEScPI8ISoYknkx+6kXz8yhY1DH/Heth1TkyHYfekw==",
  "shasum": "d827379fddcb617f74742d01b6f676b842d517e6",
  "tarball": "https://registry.npmjs.org/42.js/-/42.js-1.2.5.tgz",
  "fileCount": 68,
  "unpackedSize": 75688,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIQCCAf4CILg1nGPwb6syqP80PBabNQmpEF4NwJkcrZTbzAIgBmHFJrvMUZ9XYyqF0anLXp2PtTvBQF8BkVPam9xdTDI="
    }
  ],
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0TvCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmriLg//TmjZAsPzUWZGRaYgusPDc75X+24KKn3C9Gu5UD9xyVVXRdPz\r\n8M8deQCoo7J8MhRPNIQ5QswsnjCngddfSsvLkEILdKmzfxTNoavLYAm4FnSl\r\nczCRWNfnyoevdV/Zg0QyGM9paHgJKXuyFg6ysS7WypFPCPXEeiKdED9r0hJc\r\nF3ODOQ7c9lUxmEcWv76QcSrR60tIIPvxy74JtH9eupLJ2EeQwSCVks8B9nlU\r\nQRsZVPen+ElOtHs7lHbn20/VNH7eLC7WsQQfTtJ7tGfoxW88I836s0Yt4Dge\r\nXF1wNz8fxbDInNX9qtrUIFdWS9+G/8MEKx61iDxh7HwdXNCu+Lthp1KKSPOX\r\nbFRHF/sc+tSrdQIu/uyfKI8/ic8v/kfxYeWxw2UGkPhKNoVr0NStwu7zNn2w\r\n85rqL5cITnRzjfcuJifQfeuGiZpjN2MumpvcY3CxolwPB1Jf6Bft/6UKvxTA\r\n9j2ePM6hswO6MDd8+s0zfEIPtRI8SCIEYDU6o7jJPemkjBc4REev30PDxxyd\r\nM3YCQhtyXdnA3rYFiXvm+t8UwVrGdOrFndAfrcENGGTuwK1weo3D8gAfVYpH\r\nydWbc/9sJrHkLSX5Usw03+EaF0xuPhwUl4e3wkFgUpJETD4Iigaxf3FwAd5e\r\nRm70nKCtv2Od47UuXRNOSRk1X6ogae7PYB4=\r\n=1CR1\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:a16062b002cb0d80ce960e8e20f59bc6ff5ba43ec410c8d06b99af9402f16add

Other collected versions

1.2.622 Aug1.2.417 Dec1.2.315 Dec1.2.23 Dec1.2.119 Oct1.2.09 OctView all collected versions →