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

min-sqlite

v0.0.2

Published

The light and minimalist ORM for sqlite 3

Downloads

7

Readme

minSQLite

The light and minimalist ORM for sqlite 3

This project is currently under development.

Model example:

Trying

utils (src/Utils.js)

import { utils } from ''min-sqlite;

// strFormat
utils.strFormat(
  'SELECT $fields FROM $name WHERE $conds ;',
  '*',
  'users',
  'id = 1'
);
// return
// SELECT users FROM users WHERE id = 1 ;

// method has
const undef = undefined;
const arr = [12, 4, 5, 6];
utils.has(null, 'x');            // false
utils.has(undef, 'y');           // false
utils.has({}, undef));           // false
utils.has(arr, 0))               // true
utils.has(arr, arr.length - 1);  // true
utils.has(arr, arr.length);      // true
// method sleep
async function someFunc() {
  await utils.sleep(1000); // sleeping 1s
  // ... more code
}

// immutable Object
const objImmutable = utils.immutable({ betzy: '💘', fitorec: '🤓' });
// return { betzy: '💘', fitorec: '🤓' }
objImmutable.betzy             // '💘'
objImmutable.fitorec           // '🤓'
objImmutable.betzy = 6;        // Exception Error: Immutable!
objImmutable.firorec = 'x';    // Exception Error: Immutable!
objImmutable.newProp = 'some value'; // Exception Error: Immutable!
objImmutable.betzy                   // '💘'  (no changed)
objImmutable.fitorec                 // '🤓' (no changed)
utils.has('newProp', objImmutable);  // false

SQLite3 types (src/Types.js)


import {types} from ''min-sqlite;

types.list();                         // List of available types
types.INTEGER                         // an object type INTEGER
types.VARCHAR(30)                     // an object type VARCHAR with length 30
const bol = types.create('BOOLEAN');  // an object type BOOLEAN
types.withLen()                       // [ 'VARCHAR', 'NVARCHAR','CHARACTER', 'NCHAR' ]
types.withLen('VARCHAR');             // true
types.withLen('BOOLEAN');             // alse
types.normalizeAttr('unique', 1);     // true
types.cast.BOOLEAN(1);                // true
types.cast.BOOLEAN('0');              // false
types.cast.INTEGER('123.23');         // 123
types.cast.FLOAT('123.23');           // 123.23
types.cast.TEXT('123.23');            // '123.23' (String)
const integer = types.INTEGER;        // create a type Integer
types.is(type);                       // true
types.is(bol);                        // true
types.is(types.VARCHAR(4));           // true
types.is({});                         // false
types.is(null);                       // false
types.DEFAULT.ai = true;              // No mutation, no errors
console.log(types.DEFAULT.ai);        // false (original value)
types.columnSQLDefinition(columnName, integer)  // return SQL column definion

Contributing Guide

Por su interes, gracias =)

Contributions are welcome and are greatly appreciated! Every little bit helps, and credit will always be given.

Setting up your environment

After forking to your own github org, do the following steps to get started:

# clone your fork to your local machine
git clone https://github.com/<you-user>/minSQLite

# step into local repo
cd minSQLite

# install dependencies
npm install

Style & Linting

This codebase adheres to the Airbnb Styleguide and is enforced using ESLint.

It is recommended that you install an eslint plugin for your editor of choice when working on this codebase, however you can always check to see if the source code is compliant by running:

npm run lint

Testing

npm test

Pull Request Guidelines

...

"Pendiente", on this moment you pull and push :smile: