Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
A node wrapper for the DMOJ API. https://dmoj.ca
const dmoj = new (require('dmoj'))();
(async () => {
/**
* Fetches an uncached problem
*/
console.log((await dmoj.getProblem('cco15p1')).name); //CCO '15 P1 - Hungry Fox
/**
* Creates a cache of problems
*/
const problems = await dmoj.getProblems();
/**
* dmoj.getProblem is essentially just a promisified version of problems.get
* The only difference is that dmoj.getProblem can fetch uncached problems,
* while dmoj.getProblem can be called without doing dmoj.getProblems first.
*/
console.log((await dmoj.getProblem('cco15p1')).name); //CCO '15 P1 - Hungry Fox
console.log(problems.get('cco15p1').name); //CCO '15 P1 - Hungry Fox
const hw = problems.get('helloworld');
console.log(hw);
/**
* Fetches the basic information of the problem such as the memory/time limit
*/
await hw.fetchInfo();
console.log(`Time Limit: ${hw.timeLimit}; Memory Limit: ${hw.memoryLimit}`); //Time Limit: 2; Memory Limit: 65536
console.log(await dmoj.getProblem('asdf')); //null
/**
* Fetches an uncached contest
*/
console.log((await dmoj.getContest('dmopc14c1')).name); //DMOPC '14 October Contest
/**
* Creates a cache of contests
*/
const contests = await dmoj.getContests();
console.log((await dmoj.getContest('dmopc14c1')).name); //DMOPC '14 October Contest
console.log(contests.get('dmopc14c1').name); //DMOPC '14 October Contest
//i don't feel like explaining anymore
console.log(contests.get('christmastree').name); //Christmas Trees - Christmas Special
console.log(contests.get('dmopc14c1').labels); //['dmopc']
console.log(contests.get('asdf')); //null
const dmopc = contests.get('dmopc16c1');
console.log(dmopc);
await dmopc.fetchInfo();
console.log(dmopc.problems[0]);
const users = await dmoj.getUsers();
const me = users.get('echofox');
console.log(me);
await me.fetchInfo();
console.log(me.solved[1]);
})()
process.on('unhandledRejection', err => console.error(err));```
FAQs
A node wrapper for the DMOJ API.
The npm package dmoj receives a total of 2 weekly downloads. As such, dmoj popularity was classified as not popular.
We found that dmoj demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.