Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
worker-pouch
Advanced tools
Plugin to use PouchDB over web workers. Works transparently in browsers that support workers via Blob URLs, i.e. Firefox and Chrome.
Basically, you use the PouchDB API exactly as you're used to using it, but everything is less janky because all database operations are proxied over to a web worker.
// this pouch is powered by web workers
var db = new PouchDB('mydb', {adapter: 'worker'});
$ npm install worker-pouch
When you npm install worker-pouch
, the client JS file is available at node_modules/worker-pouch/dist/pouchdb.worker-pouch.js
. Or you can just download it from Github above.
Then include it in your HTML, after PouchDB:
<script src="pouchdb.js"></script>
<script src="pouchdb.worker-pouch.js"></script>
Then you can create a worker-powered PouchDB using:
var db = new PouchDB('mydb', {adapter: 'worker'});
The same rules apply, but you have to notify PouchDB of the new adapter:
var PouchDB = require('pouchdb');
PouchDB.adapter('worker', require('worker-pouch'));
### Debugging
WorkerPOuch uses [debug](https://github.com/visionmedia/debug) for logging. So in the browser, you can enable debugging by using PouchDB's logger:
```js
PouchDB.debug.enable('pouchdb:worker:*');
WorkerPouch proxies the normal PouchDB API over to a single global web worker, which is what runs the core PouchDB code. You can debug the worker by looking for a script starting with blob:
in your dev tools.
npm install
npm run build
Your plugin is now located at dist/pouchdb.worker-pouch.js
and dist/pouchdb.worker-pouch.min.js
and is ready for distribution.
Run npm run dev
and then point your favorite browser to http://127.0.0.1:8000/test/index.html.
The query param ?grep=mysearch
will search for tests matching mysearch
.
You can run e.g.
CLIENT=selenium:firefox npm test
CLIENT=selenium:phantomjs npm test
This will run the tests automatically and the process will exit with a 0 or a 1 when it's done. Firefox uses IndexedDB, and PhantomJS uses WebSQL.
FAQs
PouchDB over a web worker
The npm package worker-pouch receives a total of 128 weekly downloads. As such, worker-pouch popularity was classified as not popular.
We found that worker-pouch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.