No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
Sven Slootweg 67e28e9071 Initial commit hace 5 años
.gitignore Initial commit hace 5 años
README.md Initial commit hace 5 años
example.js Initial commit hace 5 años
index.js Initial commit hace 5 años
package.json Initial commit hace 5 años
yarn.lock Initial commit hace 5 años

README.md

postgresql-socket-url

Generates a well-formed URL for a given PostgreSQL domain socket path and database name. Useful when you want to use a database driver (like pg) to connect to PostgreSQL through a Unix domain socket.

Example

"use strict";

const postgresqlSocketUrl = require("postgresql-socket-url");

let url = postgresqlSocketUrl({
	socketPath: "/tmp",
	database: "myproject"
});

console.log(url); // socket:/tmp?db=myproject

API

postgresqlSocketUrl(options)

Generates the URL to connect to.

  • options:
    • socketPath: The path of the folder that contains the PostgreSQL socket. Not the path of the socket itself.
    • database: The name of the database to connect to.

Changelog

1.0.0 (September 14, 2019)

Initial release.