
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Regular Expression Transform Stream for Node.js
Create a transform stream which will buffer incoming data and push regex results
when matches can be made, i.e. when regex.exec
returns non-null value. You will probably want to
set the g
flag on regexes most of the time.
const restream = require('restream')
const Readable = require('stream').Readable
const Writable = require('stream').Writable
// your input readable stream which outputs strings
const input = 'test-string-{12345}-{67890}'
const rs = new Readable({
read: () => {
rs.push(input)
rs.push(null)
},
})
// your output writable sream which saves incoming data
const ws = new Writable({ objectMode: true })
const data = []
ws._write = (chunk, _, next) => {
data.push(chunk)
next()
}
const regex = /{(\d+)}/g
const rts = restream(regex)
rs.pipe(rts).pipe(ws)
ws.once('finish', () => {
console.log(data)
})
[ [ '{12345}',
'12345',
index: 12,
input: 'test-string-{12345}-{67890}' ],
[ '{67890}',
'67890',
index: 20,
input: 'test-string-{12345}-{67890}' ] ]
2017, Sobesednik Media
FAQs
Regular Expression Detection & Replacement streams.
The npm package restream receives a total of 2,502 weekly downloads. As such, restream popularity was classified as popular.
We found that restream 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.