Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Minimal key-value store and event subscription
Inspired by https://github.com/developit/mitt/
this
minimally was made for the browser, but works in any JavaScript runtime. It has no dependencies and supports IE9+.
This project uses node and npm. Go check them out if you don't have them locally installed.
$ npm install --save minimally
Then with a module bundler like rollup or webpack, use as you would anything else:
// using ES6 modules
import minimally from 'minimally'
// using CommonJS modules
var minimally = require('minimally')
The UMD build is also available on unpkg:
<script src="https://unpkg.com/minimally/dist/minimally.umd.js"></script>
You can find the library on window.minimally
.
import minimally from 'minimally'
const model = minimally()
// listen to an event
model.on('foo', e => console.log('foo', e) )
// Set value for key and dispatch event to subscribers
const val = { a: 'b' }
model.set('foo', val)
// Get value for key
m.get(key) === val
// working with handler references:
function onFoo() {}
model.on('foo', onFoo) // listen
model.off('foo', onFoo) // unlisten
minimally: Minimal key-value store and event subscription.
Returns minimally
Get current value for key
Returns any
Subscribe to events for key with event handler
key
(String | Number) Type of event to listen forfn
Function Function to call in response to given eventReturns void
Release subscription for key and event handler
Returns void
Set value for key and dispatch event to subscribers
key
(String | Number) The event type to invokeval
any? Any value (object is recommended and powerful), passed to each handlerReturns void
First off, thanks for taking the time to contribute! Now, take a moment to be sure your contributions make sense to everyone else.
Development Start:
This project is typed with Flow Type annotations. To ensure you have the proper typings for this project run
flow-typed install
Found a problem? Want a new feature? First of all see if your issue or idea has already been reported. If don't, just open a new clear and descriptive issue.
Pull requests are the greatest contributions, so be sure they are focused in scope, and do avoid unrelated commits.
git clone https://github.com/<your-username>/minimally
cd minimally
git checkout -b my-new-feature
npm install
git commit -am 'Add some feature'
git push origin my-new-feature
FAQs
Minimal key-value store and event subscription
The npm package minimally receives a total of 2 weekly downloads. As such, minimally popularity was classified as not popular.
We found that minimally 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 threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.