Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Foliage is lightweight tree that operates on a tree of JavaScript primitives. It is inspired by many Cursors libraries/frameworks (see prior art), however it is not nearly as ambitious. Specifically, it sacrifices robustness and purity for the benefit of build size.
Foliage can retrieve and set data similarly to an ES6 map
let plant = new Foliage({ berries: true })
// retrieve state
plant.get('berries') // true
// set state
plant.set('berries', false)
// remove state
plant.remove('berries')
graft
will clone an instance of Foliage and place a cursor to a
point within its tree:
let plant = new Foliage({ berries: true })
plant.graft('berries').valueOf() // => true
let oak = new Foliage({
squirrels: {
squeakem: { weight: 2, height: 12 }
chatters: { weight: 5, height: 8 }
}
})
let squirrels = oak.graft('squirrels')
In this example, squirrels
is a subset of oak
focused on the
squirrels
key. Under the hood, they point to the same underlying
data. This means if you set
in squirrel
, oak
will be modified as
well:
squirrels.set(['squeakem', 'weight'], 5)
oak.get(['squirrels', 'squeakem', 'weight']) // => 5
A couple of things are going on here. First, set
is used to modify
data. Second, both get
and set
accept an array of keys. When given
an array, they will traverse the tree for the leaf value instead of
just returning the key from the most immediate level.
There is nothing novel about Foliage, it shamelessly mimics:
FAQs
Styled Components for forest
The npm package foliage receives a total of 1,291 weekly downloads. As such, foliage popularity was classified as popular.
We found that foliage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.