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.
require()
node modules in PLV8. Optimize your Node.js Backend by offloading work directly onto the database (PostgreSQL). Send/receive events between Node and PLV8.
$ npm install --save plv8
install (module, [cwd])
Install a Node module which can be loaded into the plv8 context by using the require()
method.
uninstall (module)
Remove a previously installed module.
eval (code)
Evaluate a block of Javascript on the fly.
on (event, handler)
Listen for a Postgres NOTIFY event, and invoke the given handler
when the event is emitted.
require (module)
Load an installed Node module.
log (level, message)
Send a log message to the Node.js application.
emit (event, payload)
Emit an aribtrary event to the Node.js application via NOTIFY.
// setup plv8 connection
const PLV8 = require('plv8')
const plv8 = new PLV8({
client: 'pg',
connection: {
// knex.js connection object
}
})
// setup a log listener
plv8.on('log:error', msg => {
console.error(msg)
})
// setup a listener
plv8.on('user:updated', user => {
// do some stuff with the "user" object
})
// install the lodash module so that it can be loaded (via require()) later
plv8.install(require.resolve('lodash'))
.then(() => {
// eval some code
return plv8.eval(() => {
const _ = require('lodash')
return _.map([ 1, 2, 3 ], e => e + 1)
})
})
.then(result => {
// result = [ 2, 3, 4 ]
})
// send some events to the client
plv8.eval(() => {
const _ = require('lodash')
const veryImportantValue = _.map([ 1, 2, 3 ], e => e + 1)
// maybe I want to send this event to the client, but continue doing more things
plv8.emit('user:updated', {
username: 'tjwebb',
email: 'tjwebb@langa.io'
})
try {
return veryImportantValue + 1
}
catch (e) {
plv8.log('error', e)
return 0
}
})
This module requires the plv8 Postgres extension.
$ easy_install pgxnclient
$ pgxnclient install plv8
This is a fork of plv8x that has been streamlined down to the essentials, and extended with additional API features. Important differences:
MIT
FAQs
require() node.js modules in plv8
The npm package plv8 receives a total of 88 weekly downloads. As such, plv8 popularity was classified as not popular.
We found that plv8 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.