npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@veraa/npm-sqlite3-simplifier

v1.1.1

Published

Some functions to simplify the use of SQLite3

Downloads

5

Readme

SQLite Simplifier for NodeJS

¿How it works?

This package was made to simplify the SQLite functions (although, their documentation is horrible, so I'm here to help you)

Important Information:

  • The package is totally public (everyone can see the code), located in https://github.com/Vera0011/NPM-sqlite3-simplifier.git
  • The package INCLUDES SQLite3 AND SQLCypher
  • If you liked the package, leave a star in the repository, please!
  • Tha package is made to have different options, that we will see down here

Starting

1- First of all, you need to install the package, like this:

npm i @veraa/npm-sqlite3-simplifier

2- Import in your code the functions (you can just import those you need):

const {databaseLoad, databaseRun, databaseGet, databaseAll, databaseClose, databaseDropTable } = require("@veraa/npm-sqlite3-simplifier");

3- And that's it! The functions are asynchronous, so don't forget to use async / await

Configuration:

  • SQLCypher is activated from default (to encrypt all data).
  • If you want to disable SQLCypher, go to the package.json of the module, and in the options section, change "isCypherEnabled": true to "isCypherEnabled": false.
  • IF YOU USE SQLCypher, change the password, located in package.json of the module, "key" section (you can change it to whatever you want).

Functions, parameters, etc

1-

await databaseLoad(path, databaseName);
/** 
@params
- Path (string)
Path where you want the database to get started

- databaseName (string)
The name you want for your database (set to "database.db" for default)

@Return
- If all is okay, returns 1
- If an error occures, returns 0 and a error message
*/

2-

await databaseRun(sql, params);

/** 
@params
- sql (string)
SQL sentence used. Example: `CREATE TABLE IF NOT EXISTS example (example TEXT)`

- params (array of strings)
If you want to use parameters, for example: [userData, userName], use this parameter. Default is null

@Return
- If all is okay, returns 1
- If an error occures, returns 0 and a error message
*/

3-

await databaseGet(sql, params);

/** 
@params
- sql (string)
SQL sentence used. Example: `INSERT INTO example VALUES (example)`

- params (array of strings)
If you want to use parameters, for example: [userData, userName], use this parameter. Default is null

@Return
- If all is okay, returns the first coincidence found in the database
- If an error occures, returns 0 and a error message
*/

4-

await databaseAll(sql, params);

/** 
@params
- sql (string)
SQL sentence used. Example: `SELECT * FROM example WHERE examle="example"`

- params (array of strings)
If you want to use parameters, for example: [userData, userName], use this parameter. Default is null

@Return
- If all is okay, returns all the coincidences found in the database
- If an error occures, returns 0 and a error message
*/

5-

await databaseClose();

/** 
@Return
- If all is okay, returns 1
- If an error occures, returns 0 and a error message
*/

6-

await databaseDropTable(table);

/** 
@params
- table (string)
Name of the table to drop.

@Return
- If all is okay, returns 1
- If an error occures, returns 0 and a error message
*/