Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 880 Bytes

Readme.md

File metadata and controls

47 lines (32 loc) · 880 Bytes

Leak parser

Init

cp .template.env .env

# interactively set new db pass and location of the file to import
nano .env

# Start local db instance
docker compose up -d

# install dependencies
npm i

# compile project
npm exec tsc -p

# create initial table
echo 'CREATE TABLE IF NOT EXISTS tuples(email TEXT, password TEXT, frequency INTEGER DEFAULT 1, UNIQUE (email, password));' | docker compose exec -T postgres psql -U postgres

# run import script
node --env-file=./.env ./dist/index.js

Reuse

# interactively set new location of the file to import
nano .env

# run import script
node --env-file=./.env ./dist/index.js

Check results

echo 'select * from tuples limit 20;' | docker compose exec -T postgres psql -U postgres

Run code in dev watch mode

ls *.ts | entr -scc 'npm exec tsc -p && node dist/index.js'