Comparing version 0.3.2 to 1.0.0-0
{ | ||
"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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
3
12
204
13950
4
85
4
1
+ Addedpg-connection-string@0.1.3(transitive)
- Removedbluebird@^3.3.5
- Removedbluebird@3.7.2(transitive)
Updatedpg@^8.9.0
Updatedpg-connection-string@^0.1.3