
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
rootedbox-two-d-array
Advanced tools
A simple utility to create a 2D array with specified dimensions and a default value.
Install the package using npm:
npm install rootedbox-two-d-array
or yarn
yarn add rootedbox-two-d-array
Require the package in your JavaScript or Node.js project:
const twoDArray = require('yourusername-two-d-array');
Then, use the twoDArray function to create a new 2D array with the desired dimensions and default value:
const rows = 3;
const cols = 4;
const defaultValue = 0;
const myArray = twoDArray(rows, cols, defaultValue);
console.log(myArray);
// Output:
// [
// [0, 0, 0, 0],
// [0, 0, 0, 0],
// [0, 0, 0, 0]
// ]
If you don't provide a default value, the array will be filled with null:
const myArray = twoDArray(rows, cols);
console.log(myArray);
// Output:
// [
// [null, null, null, null],
// [null, null, null, null],
// [null, null, null, null]
// ]
FAQs
easy create 2 d arrays
We found that rootedbox-two-d-array 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.