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

@togethercrew.dev/db

v3.0.70

Published

All interactions with DB

Downloads

434

Readme

mongo-lib

Interactions with mongo database.

Maintainability Test Coverage

Features

Linter

The CI Pipeline uses super-linter. You can run it locally with the following command:

docker run -e RUN_LOCAL=true -e TYPESCRIPT_DEFAULT_STYLE=prettier -e VALIDATE_DOCKERFILE_HADOLINT=false -v $(pwd):/tmp/lint github/super-linter:slim-latest
Windows: docker run -e RUN_LOCAL=true -e TYPESCRIPT_DEFAULT_STYLE=prettier -e VALIDATE_DOCKERFILE_HADOLINT=false -v "$(Resolve-Path .):/tmp/lint" github/super-linter:slim-latest

Note: We have disabled HADOLINT for now as we are getting an error: qemu: uncaught target signal 11 (Segmentation fault) - core dumped.

Maintainability Test Coverage

Tests

The CI Pipeline uses the test target from the Dockerfile to run the tests. You can run it locally with the following command:

docker compose -f docker-compose.test.yml up --exit-code-from app --build

Note: This will create a /coverage folder where you can review the coverage details.

User interface

User {
  discordId: Snowflake,
  email?: string,
  communities?: [Types.ObjectId]
  tcaAt?: Date;
  unverifiedTelegramUsername?:string;
}

Community interface

Community {
    name: string,
    avatarURL?: string,
    users?: [Types.ObjectId],
    platforms?: [Types.ObjectId],
    tcaAt?: Date;
    roles?: ICommunityRoles[];
}

Platform interface

Platform {
    name: string,
    community: Types.ObjectId,
    metadata?: Record<string, any>, // dynamic object since structure can change
    disconnectedAt?: Date | null,
    connectedAt?: Date | null;
}

Module interface

Module {
  name: 'hivemind';
    community: Types.ObjectId;
    options?: {
        platforms: Array<{
            platform: Types.ObjectId;
            metadata?: Record<string, any>; // dynamic object since structure can change
        }>;
    }
}

Heatmap interface

HeatMap {
    date?: string,(format: "YYYY-MM-DD")
    thr_messages: Array<number>,
    lone_messages: Array<number>,
    replier: Array<number>,
    replied_per_acc: Array<objects> [{account: "account name", count: "count of reply"}],
    replied: Array<number>,
    mentioner: Array<number>,
    mentioner_per_acc: Array<objects> [{account: "account name", count: "count of mention"}],
    mentioned: Array<number>,
    reacter: Array<number>,
    reacted_per_acc: Array<objects> [{account: "account name", count: "count of reaction"}],
    reacted: Array<number>,
    channelId: string,
    account_name: string
}

GuildMembers interface

GuildMember {
  discordId: Snowflake,
  username: string,
  avatar?: string | null,
  roles: Snowflake[],
  joinedAt: Date | null,
  isBot?: boolean,
  discriminator?: string,
  permissions?: string,
  deletedAt?: Date | null,
  globalName?: string | null;
  nickname?: string | null;
}

Channel interface

Channel {
    id: Snowflake,
    name?: string | null,
    parent_id?: string | null,
    permissionOverwrites?: IOverwrite[],
    deletedAt?: Date | null,
    type: number
}

Role interface

Role {
    id: Snowflake,
    name: string,
    color: number,
    deletedAt?: Date | null
}

Rawinfo interface

rawinfo {
  type: number,
  author: Snowflake,
  content: string,
  createdDate: Date,
  user_mentions: Array<Snowflake>,
  role_mentions: Array<Snowflake>,
  reactions: Array<Snowflake>,
  replied_user: Snowflake | null | undefined,
  messageId: Snowflake,
  channelId: Snowflake,
  channelName: string | null,
  threadId: Snowflake | null,
  threadName: string | null,
  isGeneratedByWebhook: boolean
}

Memberactivities interface

memberactivities {
    date: Date,
    all_active: Array<string>,
    all_consistent: Array<string>,
    all_vital: Array<string>,
    all_connected: Array<string>,
    all_paused: Array<string>,
    all_new_disengaged: Array<string>,
    all_disengaged: Array<string>,
    all_unpaused: Array<string>,
    all_returned: Array<string>,
    all_new_active: Array<string>,
    all_still_active: Array<string>,
    all_dropped: Array<string>,
    all_joined: Array<string>,
    all_disengaged_were_newly_active: Array<string>,
    all_disengaged_were_consistently_active: Array<string>,
    all_disengaged_were_vital: Array<string>,
    all_lurker: Array<string>,
    all_about_to_disengage: Array<string>,
    all_disengaged_in_past: Array<string>,
    all_joined_day: Array<string>,

}

Token interface

Token {
    token: string,
    user: Types.ObjectId,
    type: string,
    expires: Date,
    blacklisted?: boolean
}