Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
:page_facing_up: Read the documentation here
:cat: Contribute for the greater good
DataField is a library that helps you wrangle your awesome collections of data you obtain from different sources.
Imagine you are building a web application that deals with users. You make an API request and receive an array of 100 entries which look like this one below:
{
"_id": "5b420ae94fe6464ff91f5de8",
"index": 0,
"guid": "871eebf0-9983-4eb5-a0b5-59372a2fbecd",
"isActive": true,
"balance": "$1,268.06",
"age": 41,
"name": {
"first": "Pearlie",
"last": "Osborne"
},
"company": "PIVITOL",
"email": "pearlie.osborne@pivitol.net",
"phone": "+1 (992) 418-2307",
"address": "190 River Street, Spelter, Tennessee, 1088",
"registered": "Monday, April 18, 2016 7:35 AM",
"tags": ["ad", "magna", "aliqua"],
"friends": [{"id": 0, "name": "Whitney Snow"}, {"id": 1, "name": "Garza Hernandez"}, {"id": 2,"name": "Lourdes Conley"}]
}
With this library it is rather easy to perform various actions on your data.
const users = new DataField(arrayOfUsers)
Now your data is stored in an instance of DataField class.
Each method that performs any kind of selection or filtering returns a new instance of DataField and can be chained.
Math methods return primitives and can not be chained
To extract your data use .values()
or toArray()
Lets filter our data. We need users who are 30 years old or older, but not 41 years old and have at least 2 friends, but less than 10. Also we want our list sorted by last name in descending order. Then we are done so we want an array out of that:
users.where('age').gte(30).not(41).where('friends').range(2, 10).sort({by: 'name.last', order: 'desc'}).toArray()
Or you can go more object-oriented way (this one below is kinda weird request although):
users.where('age').any({
range: [8, 88],
lte: 18,
gt: 60,
not: 42,
is: false
})
That's it. API is short and simple. Also, read the Documentation
npm i datafield
FAQs
Sort, select, filter, evaluate and perform maths on your arrays of data
The npm package datafield receives a total of 0 weekly downloads. As such, datafield popularity was classified as not popular.
We found that datafield 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.