
Security News
npm v12 Ships With Install Scripts Off by Default, Begins Deprecating 2FA-Bypass Tokens
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.
Given two connected pg-native clients, use a very efficient row by row copy with libpq to move data between them.
$ npm install pg-pipe
I'm using sync calls of connect and query below to make the example more readable, but the actual piping is completely non-blocking. You can use completely non-blocking queries and connection as well, I just think the example is more readable with less callbacks in it.
var pipe = require('pg-pipe');
var Client = require('pg-native');
var from = new Client();
var to = new Client();
from.connectSync();
to.connectSync();
//prepare the source client to start
//sending rows over the copy protocol
from.querySync('COPY some_table TO stdout');
//prepare the destination client to start
//recieving rows over the copy protocol
to.querySync('COPY some_table FROM stdin');
//now use libpq's built-in efficient row-by-row copy mode
//to move data at the speed of magic!
pipe(from, to, function(err) {
//callback will be called once the operation is done
});
pipe(from:Client, to:Client, callback:function(err:error))Pipes data from one client to another. Both clients need to be connected and already in their respective COPY modes which are started by issuing the corresponding COPY FROM / COPY TO queries.
The MIT License (MIT)
Copyright (c) 2014 Brian M. Carlson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Pipe one table to another very efficiently
The npm package pg-pipe receives a total of 4 weekly downloads. As such, pg-pipe popularity was classified as not popular.
We found that pg-pipe 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
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.

Research
/Security News
Socket tracks the activity as Operation “Muck and Load”: a threat actor uses commit-farming workflows, public dead drops, and protected archives to stage Windows RAT and infostealer malware.

Security News
pnpm 11.10 hardens registry auth to block token redirection, tightens pack-app and deploy, and makes the Rust port (v12) installable.