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

codefellows-slipup

v1.0.0

Published

401 Codefellows Midterm project using Javascript

Downloads

5

Readme

SlipUp

An npm package library that logs and saves error events in a PostgreSql database.

Version

Contributors: Ryan Geddes, Davee Sok, Ben Hill, Jonathon Lee.

Version: 0.0.7

Project Overview

Purpose of our application is provide user with an easy method to automatically log, filter, and search through their projects error events. The goal is to provide google functionality for error events. Our architecture is based off of splunk.

Architecture

Handles data pipeline through 3 distinct tiers.

- Forwarder
- Indexer
- Search Head

UML Diagram

Our UML diagram will give you insight on how SlipUp is wired. Click below for a whiteboard visual.

Project Tasks

Project notes

Every project needs a task list and notes for consistent progress and documentation. We used github projects do document our build progress. Link below will show you our progress notation.

Dependencies and Tools

Getting started

  1. Install SlipUp library with the following commands. Note: must have npm installer.
$npm i codefellows-slipup
  1. Input Postgres username.
Upon installation, SlipUp will request Postgres username. Note: User must have a Postgres account.
Note: Mac users should use mac login credentials.
  1. Postgres password.
Upon inputting Postgres username SlipUp will request Posgres password. 
This will allow user to save error logs in Postgres.
  1. Choose port.
User is given the option to assign an env port. If no port is chosen SlipUp will assign default 
port 5432.
  1. Name your Postgres db.
User is given the option to assign a Postgres database name. 
If a name is not chosen SlipUp will assign (Splunk) as the database name.
  1. Note on projects that use Postgres and .env files.
SlipUp uses Prisma as an interface with Postgres database. Prisma by default searches for a 
DATABASE_URL variable to connect to any env file it detects.
Note: Must reserve DATABASE_URL variable name in order for SlipUp to work.

Using SlipUp

Require SlipUp library Ex:

const slipUp = require('codefellows-slipup');


function test1(param) {
  try {
    let num = 123;
    return num.toUpperCase();
  } catch (error) {
    slipUp.logError(error, 'userId', param, 'enter custom note or identifier');
  }
}

SlipUp Exports a singleton that has a method called logError(). logError() accepts the following 4 parameters which will be uploaded automatically to a Sql database when it is called.

Parameters errorObject: This parameter is required. This is the error object in your try catch block. It logs an error object to the database and expects a standard error object. Columns will automatically be created for each error objects in the database that contain the following properties:

  • Error name
  • Error message
  • Error stack

userId: This parameter is required. It takes a string. Note: This parameter is used to identify the userId for the programmer. This is used to identify a developer's userId to an error event.

After getting started ➡ CLI commands:

These are command options we can use in our cli(command line interface/ terminal). Entering the command line

cd into node_modules/codefellows-slipup

Note: In order to use a tag command we need to add two dashes -- before selecting each command. The following commands are valid in the command line.

- $node query get
- $node query update
- $node query delete

List of tag commands for get method Shows you a list of errors stored in your database

  --id
  --userid
  --date
  --errortype
  --userparam

An example of a get command in cli

- $node query get --userid=“userid124” --errortype=ReferenceError

List of tag commands for update method Allows users to update a note for an error. Update error based on recordId and new Note.

--id
--usernote

An example of a update command in cli

- $node query update --id=24 --usernote="this is the new updated note"

List of tag commands for delete method Allows users to delete based on record id.

--id

An example of a delete command in cli

- $node query delete --id=24 

Information about Prisma

Prisma is used to help with Postgres.

Prisma Install Instructions

Note: Prisma is automatically installed upon SlipUp installation. These links are purely for documentation purposes.

Sql cli database commands:

  • Enter: psql >>> Opens psql in terminal
  • \c into table >>> Lets you view a table
  • \dt describe table >>> lets you view whats in table.
  • Enter: CREATE DATABASE dbname; In .env:
`DATABASE_URL = postgres:localhost:5432/DATABASE-NAME`
To use schema file to start database:
`psql -f file.sql -d DATABASE-NAME`
Add to Heroku online, add this command to terminal:
`heroku pg:psql -f path/to/schema-file.sql --app your-heroku-app-name-here`

List of Common Commands:

- \l - to view all databases
- \c DATABASE-NAME - to navigate into your database
- \dt - to view the tables in your database
- \q to quit

Objectives

  • [ ] node.js documentation => access build in api methods

Explanation of Config Steps

post install remove prisma .env file, sym link to .env in node modules, then run prisma intro and generate steps