Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
kefir-collection
Advanced tools
Stream helper for managing a collection of items that may be updated, added and removed.
Stream helper for managing a collection of items that may be updated, added and removed.
npm install kefir-collection
Create a collection stream with KefirCollection(items)
. This stream has a few helper functions for managing items:
setItems(item_id, merge=false)
Sets the collection's items, optionally merging with existing itemsgetItem(item_id)
Returns a stream for an individual itemupdateItem(item_id, update)
Updates the item, returns individual stream for the updated itemcreateItem(new_item)
Creates a new item, returns individual stream for the created itemremoveItem(item_id)
Removes an item, returns the overall items streamKefirCollection = require 'kefir-collection'
items$ = KefirCollection [
{_id: 123, name: "Test"},
{_id: 425, name: "Jones"},
{_id: 850, name: "Frank"}
]
items$.onValue (items) ->
console.log '\n[items]', items
items$.getItem(123).onValue (item) ->
console.log '\n[item 123]', item
# Run some operations
items$.updateItem 123, name: "Hello"
create$ = items$.createItem {_id: 999, name: "Ok"}
create$.onValue (item) ->
console.log '\n[new item]', item
items$.removeItem 850
[items] [ { _id: 123, name: 'Test' },
{ _id: 425, name: 'Jones' },
{ _id: 850, name: 'Frank' } ]
[item 123] { _id: 123, name: 'Test' }
[items] [ { _id: 123, name: 'Hello' },
{ _id: 425, name: 'Jones' },
{ _id: 850, name: 'Frank' } ]
[item 123] { _id: 123, name: 'Hello' }
[items] [ { _id: 123, name: 'Hello' },
{ _id: 425, name: 'Jones' },
{ _id: 850, name: 'Frank' },
{ _id: 999, name: 'Ok' } ]
[new item] { _id: 999, name: 'Ok' }
[items] [ { _id: 123, name: 'Hello' },
{ _id: 425, name: 'Jones' },
{ _id: 999, name: 'Ok' } ]
FAQs
Stream helper for managing a collection of items that may be updated, added and removed.
The npm package kefir-collection receives a total of 5 weekly downloads. As such, kefir-collection popularity was classified as not popular.
We found that kefir-collection 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.