Catalog npm
Back to packageRELEASE DETAILS

1.2.6

npm

42.js

Library for 42 school API in js (ts)

42apijstranscendencets
Published22 Aug 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-H+PTYOj39Htr2UcIMS+92ItpMN8rvUZKRoW2oCTeWK+rS4rRDPdUowy9oIeKsF0y+9tNkUBh6OcnkPr56QcgtQ==",
  "shasum": "14e3b23ade0f45343df123a0afad97072f23b182",
  "tarball": "https://registry.npmjs.org/42.js/-/42.js-1.2.6.tgz",
  "fileCount": 68,
  "unpackedSize": 75503,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCIAIJg03B1yV7ocePbzj4OKoYoCMNxd7wFbcrLBFlYq78AiBxllpdMRogGtY8zMRGvXQn8Bej8128Mqoi1fhKlIVNfQ=="
    }
  ]
}

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:cd6bfddb939f9ef8d24dc1f22b21c276c54c0ea61ef192015630d8e9b65b4e1d

Other collected versions

1.2.525 Jan1.2.417 Dec1.2.315 Dec1.2.23 Dec1.2.119 Oct1.2.09 OctView all collected versions →