New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

express-sqlite-auth

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

express-sqlite-auth

This project is a boilerplate project that provides a complete solution for building a secure and scalable authentication API using TypeScript and SQLite. It includes built-in methods for initializing an SQLite3 database, interacting with it using TypeScr

unpublished
latest
npmnpm
Version
3.0.3
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Express-SQLite-Auth-Boilerplate

This project is a boilerplate project that provides a complete solution for building a secure and scalable authentication API using TypeScript and SQLite. It includes built-in methods for initializing an SQLite3 database, interacting with it using TypeScript instead of SQL, and Express boilerplate that uses these methods. It also holds a basic example of user authentification that makes use of the EntityManager class to interact with the db through Typescript. Built-in features:

  • Password encryption using bcrypt
  • Authentification using jsonwebtoken
  • Joi validation

dbManager:

The class dbManager provides a method to create a db.sqlite3 database, connect to it using package sqlite3, and provide a method that implements the factory design pattern to initiate instance of the EntityManager, A simple example of how to make use of it:

interface UserModal extends EntityInterface {
    name: string;
    email: string;
    password: string;
}

const dbManager = new DbManager({ logs: false });

//creates db.sqlite3 file if it doesn't exist, and initiates a connection to the db
await dbManager.initDB();

//create an entity manager from the interface UserModal, with table name "User"
const UserManager = dbManager.getEntityManager<UserModal>("User");

[
    { name: "John", email: "fez", password: "fez" },
    { name: "John", email: "elvis", password: "elvis" },
].forEach(async (user) => {
    await UserManager.save(user);
});

await UserManager.delete({name: "John"});

await UserManager.find({{name: "John"}}, async (users: UserModal[]) => {
    console.log(users);
});

Installation:

git clone https://github.com/Hamza-Bouhelal/Express-SQLite-Auth-Boilerplate.git
cd Express-SQLite-Auth-Boilerplate
mkdir db
copy .env.default .env
yarn
yarn dev

FAQs

Package last updated on 01 May 2023

Did you know?

Socket

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.

Install

Related posts