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

easyback

v1.0.5

Published

Creates api end point where you can crud on db prefixed db tables with a little advanced where,order by selection

Downloads

4

Readme

EasyBack

Motivation

Developing a backend for a project often involves writing repetitive code for database operations such as insert, update, create, list, and more. When dealing with multiple tables, this redundancy can quickly become a burden. EasyBack simplifies backend development by automaticly providing rest interface for all It derives table definitions from your database and prepares a user-friendly interface API.

Insert

Perform an insert operation with a simple POST request. If you provide an ID, it updates the record with that identity. If the ID is null, 0, undefined, or an empty string, EasyBack creates a new record.

fetch("/api/v1/products", {
  method: "POST",
  header: { "content-type": "application/json" },
  body: JSON.stringify({ name: "Jean", user: 123, description: "My Jean" }),
});

Update

Update a field by specifying the ID of the record.

fetch("/api/v1/products", {
  method: "POST",
  header: { "content-type": "application/json" },
  body: JSON.stringify({ id: 97, name: "Red jean" }),
});

List of Records

Retrieve data with flexible filtering using the where parameter. You can specify conditions like id,eq,97, name,like,ice, or even multiple conditions like language,in,en,tr,ua. EasyBack also supports sorting with the orderBy option.

fetch(
  "/api/v1/products?where=name,like,jean|category,eq,45|orderby=name&orderby=name"
);

The return data format is always a JSON object with the structure { msg: 'not found', error: 1, data: e } for error handling. If no records are found in the database, it returns an empty array ([]). On successful insert or update, it provides information like { affected: 1, insertedId: 132 }.

Recipes

Sequental

Here's an example of how to use EasyBack to retrieve images for a specific page using its slug:

let pageData = await fetch(`/api/v1/pages?where=id,eq,${slug}`).then((r) =>
  r.json()
);
let images = [];
if (!pageData.error && pageData.data.length) {
  images = await fetch(
    `/api/v1/images?where=page,eq,${pageData.data[0].id}`
  ).then((r) => r.json());
}

Simplify your backend development with EasyBack and focus on building your application's unique features instead of writing repetitive code.

Authentication

We prepared login/auth tracking but it can be shilded with your implementation on app.

Todo

1) pageing
2) example to include custom auth