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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@evdy-consumer/dailyom-suite-services

v0.0.17

Published

This library provides various services for the DailyOM Suite, including requests to internal API's and integrations with third-party APIs like Stripe and Thinkific. It is designed to be used across different applications within the suite, ensuring a consi

Readme

@dailyom-suite/services

This library provides various services for the DailyOM Suite, including requests to internal API's and integrations with third-party APIs like Stripe and Thinkific. It is designed to be used across different applications within the suite, ensuring a consistent and efficient way to handle data fetching and processing

This library was generated with Nx

Command used to generate this library:

nx generate @nx/js:lib libs/services

Lib structure

The services inside this library are organized into different directories based on their functionality. The general structure is as follows:

libs/services
├── src
│   ├── lib
│   │   ├── internal
│   │   │   ├── private
│   │   │   └── public
│   │   └── third-party
│   └── index.ts
└── README.md

Each new service should be added under the src/lib directory, either in the internal or third-party subdirectories, depending on whether it interacts with internal APIs or third-party services. Additionally we have agreed on structuring each service with a consistent CRUD pattern based on the resource it interacts with. This means that each service should have methods for creating, reading, updating, and deleting resources as applicable.

Public vs Private

The internal directory is further divided into private and public subdirectories:

  • Private: Contains services that are not intended for public use and are used internally within the application. Additionally, these services are protected by authentication and authorization mechanisms.
  • Public: Contains services that are intended to be used without authentication, such as public APIs or endpoints that do not require user credentials.

Example structure for a user service:

  /src
  └── /lib
      └── /internal
          └── /private
              └── /users
                  ├── get.ts
                  ├── post.ts
                  ├── update.ts
                  └── delete.ts

If there is a need for a nested service it can be placed in a subdirectory within the main resource directory.

Example structure for a user id service:

  /src
  └── /lib
      └── /internal
          └── /private
              └── /users
                  ├── get.ts
                  ├── post.ts
                  ├── update.ts
                  └── delete.ts
                    └── /id
                        ├── get.ts
                        ├── update.ts
                        └── delete.ts

Add a new service

To add a new service to this library, follow these steps:

  1. Create a new directory under src/lib/internal or src/lib/third-party based on the type of service.
  2. Inside the new directory, create a file for each method you want to implement (e.g., get.ts, create.ts, update.ts, delete.ts).
  3. Implement the logic for each method in its respective file.
  4. Export the methods from the src/lib/index.ts file to make them available for import in other parts of the application.
  5. Run the following command to ensure the new service is properly built and ready for use:
nx build services

Validation

To ensure the data integrity and correctness of the payloads sent to the services, we use Zod for schema validation. Each service should have a corresponding schema defined in the @lib/services/schemas library. For example, if you are creating a service for user login, you would define a schema in the @lib/services/schemas library and use it in your service like this:

/schemas/login.schema.ts

import { z } from 'zod/v4';

export const loginSchema = z.object({
  email: z.email(),
  password: z.string().min(8, 'Password must be at least 8 characters long'),
});

export type LoginSchema = z.infer<typeof loginSchema>;

/lib/.../login/post.ts

import { zodValidate } from '@lib/services/utils';
import { loginSchema, LoginSchema } from '@lib/services/schemas';
export const login = async (payload: LoginSchema) => {
  const validatedPayload = zodValidate(loginSchema, payload);

  const response = await fetch('example-url', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(validatedPayload),
  });

  return response.json();
};

Running unit tests

Run nx test services to execute the unit tests via Jest.

Usage

To use the services provided by this library, you can import them in your application code as follows:

import { createUser, getUsers } from '@evdy-consumer/dailyom-suite-services';

CI

PRs that contain changes to services will run tests and builds to ensure project structure is adhered to.