New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pgtools

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pgtools - npm Package Compare versions

Comparing version 0.3.2 to 1.0.0-0

src/bin/createdb.js

18

package.json
{
"name": "pgtools",
"version": "0.3.2",
"version": "1.0.0-0",
"description": "Pure Node.js implementation of PostgreSQL's createdb and dropdb tools",
"main": "index.js",
"main": "./src/index.js",
"dependencies": {
"bluebird": "^3.3.5",
"pg": "^8.4.0",
"pg-connection-string": "^2.4.0",
"pg": "^8.9.0",
"pg-connection-string": "^0.1.3",
"yargs": "^5.0.0"
},
"bin": {
"createdbjs": "./createdb.js",
"dropdbjs": "./dropdb.js"
"createdbjs": "./src/bin/createdb.js",
"dropdbjs": "./src/bin/dropdb.js"
},

@@ -19,7 +18,8 @@ "devDependencies": {

"nyc": "^11.0.3",
"standard-version": "^8.0.1"
"prettier": "^2.8.4",
"standard-version": "^4.2.0"
},
"scripts": {
"coverage": "nyc report --reporter=text-lcov | coveralls",
"test": "nyc node test.js",
"test": "nyc node src/test.js",
"docker": "docker-compose up dbcreate && docker-compose up -d db",

@@ -26,0 +26,0 @@ "release": "standard-version"

@@ -33,3 +33,3 @@ # pgtools

```javascript
const pgtools = require('pgtools');
const { createdb, dropdb } = require("pgtools");

@@ -40,24 +40,10 @@ // This can also be a connection string

const config = {
user: 'postgres',
password: 'some pass',
user: "postgres",
password: "some pass",
port: 5432,
host: 'localhost'
}
host: "localhost",
};
pgtools.createdb(config, 'test-db', function (err, res) {
if (err) {
console.error(err);
process.exit(-1);
}
console.log(res);
pgtools.dropdb(config, 'test-db', function (err, res) {
if (err) {
console.error(err);
process.exit(-1);
}
console.log(res);
});
});
// a promise API is also available if cb is omitted
await createdb(config, "test-db");
await dropdb(config, "test-db");
```

@@ -67,20 +53,15 @@

`pgtools.createdb(config, dbname [, cb(err)])`
`createdb(config, dbname): Promise<void>`
`pgtools.dropdb(config, dbname [, cb(err)])`
`dropdb(config, dbname): Promise<void>`
* _object_ __config__
- _object_ **config**
An object with user, password, port, and host properties. This can
also be a node-postgres compatible connection string.
An object with user, password, port, and host properties. This can
also be a node-postgres compatible connection string.
* _string_ __dbname__
- _string_ **dbname**
The name of the database to create.
The name of the database to create.
* _function_ __cb__
A callback that takes an error argument. If cb is omitted the
function will return a Promise.
## Bins

@@ -90,8 +71,8 @@

* `createdbjs`: which emulates pgtools' `createdb` functionality.
* `dropdbjs`: which emulates pgtools' `dropdb` functionality.
- `createdbjs`: which emulates pgtools' `createdb` functionality.
- `dropdbjs`: which emulates pgtools' `dropdb` functionality.
## Node.js support
We support all LTS versions from 6 and up. We try to keep up with the latest Node.js version.
We support all LTS versions from 10 and up. We try to keep up with the latest Node.js version.

@@ -98,0 +79,0 @@ ## Releasing

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc