
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.
array-driver
Advanced tools
A simple utility package for manipulating arrays. This package contains some useful methods that can save a lot of time during development.
You can install array-driver using NPM:
npm install array-driver
First configure the package
const arrayDriver = require('array-driver');
arrayDriver.config();
Then start using the functions
// Example usage
const students = [
{ id: 1, name: 'Alice', grade: 'A' },
{ id: 2, name: 'Bob', grade: 'B' },
{ id: 3, name: 'Charlie', grade: 'C' },
{ id: 4, name: 'David', grade: 'B' },
{ id: 5, name: 'Eve', grade: 'A' },
];
// Define the search criteria callback function
const searchCriteria = (value) => value.grade === 'B';
// Define the update criteria callback function
const updateCriteria = (element) => {
element.grade = 'A+';
};
// Call the updateMany function
const updatedStudents = students.updateMany(searchCriteria, updateCriteria);
console.log(updatedStudents);
/*
Output:
[
{ id: 2, name: 'Bob', grade: 'A+' },
{ id: 4, name: 'David', grade: 'A+' }
]
*/
const data = [
{ name: "Alice", city: "New York", age: 25 },
{ name: "Bob", city: "New York", age: 30 },
{ name: "Charlie", city: "San Francisco", age: 25 },
{ name: "Dave", city: "San Francisco", age: 30 },
];
const example1 = data.groupBy('city');
// Output:
// {
// "New York": [
// { name: "Alice", city: "New York", age: 25 },
// { name: "Bob", city: "New York", age: 30 }
// ],
// "San Francisco": [
// { name: "Charlie", city: "San Francisco", age: 25 },
// { name: "Dave", city: "San Francisco", age: 30 }
// ]
// }
const arr = [
{ name: "Charlie", age: 35 },
{ name: "David", age: 40 },
{ name: "Eve", age: 45 }
];
arr.deleteAllWhere(obj => obj.name == 'Charlie');
console.log(arr);
// [
// { name: "David", age: 40 },
// { name: "Eve", age: 45 }
// ];
see all the methods available here
This project is licensed under the ISC License - see the LICENSE file for details.
FAQs
'useful custom array methods'
We found that array-driver 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.