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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gokiteam/dev-tools

v1.3.0

Published

Goki Team Dev Tools

Readme

Goki Dev Tools

Tools and common codes that we may use in our microservices are provided in this module.

Table of Contents

Installation

Using npm command:

npm i --save @gokiteam/dev-tools

Usage

Container

There's a Container entity that can be configured to create singleton instances of provided helpers. You can declare and instantiate it once and use that instance everywhere in your project. You can also import and instantiate one helper on demand if needed, but it's recommended to use Container entity to have a cleaner implementation and prevent redundant code.

Each config param is optional and can be defined if needed.

const container = new Container ({
  logger: WinstonLogger,
  config: {
    redis: {/* config here */},
    rollBar: {/* config here */},
    errorLogger: {/* config here */},
    lockProvider: {/* config here */},
    endpoints: {/* config here */},
    healthCheck: {/* config here */},
  }
})

Redis

This component uses ioredis and creates a simple interface for redis.

Endpoints

Endpoints is a component that represents how other services can communicate with this service. It includes all gRPC and REST APIs and also all messaging consumers.

Usage
  • Registering an endpoint:
// batch
container.Endpoints.batchRegister([
  {
    group: 'group.nestedGroup',
    name: 'endpointName',
    schema: JoiToSwagger(JoiSchema),
    isPublic: true,
    responses: []
  },
  {
    group: 'group.nestedGroup',
    name: 'endpointName',
    schema: JoiToSwagger(JoiSchema),
    isPublic: true,
    responses: []
  }
])

// single
container.Endpoints.register({
  group: 'group.nestedGroup',
  name: 'endpointName',
  schema: JoiToSwagger(JoiSchema),
  isPublic: true,
  responses: []
})
  • Getting the endpoints:
const endpoints = container.Endpoints.list()

Error Logger

Logs the error appropriately and if RollBar is enabled, forwards the data to it too.

Usage
container.ErrorLogger.log(error, 'message', { /* any meta data */ })

Health Check

This component is responsible for preparing the health status of the service. Don't forget to register new components to the Health Check component to be checked during calls.

Usage:
  • Registering a new item:
container.HealthCheck.register({
  group: 'group.nestedGroup',
  name: 'TestComponent',
  method: async () => {
    // async method to prepare the item's health
    return {}
  }
})
  • Checking the status:
const status = await container.HealthCheck.check()

Lock Provider

It creates an interface for locking and unlocking resources with RedLock.

Usage
const lock = await container.LockProvider.lock(`resource`)
// operations...
lock.unlock()

Utils

There are some utils in this module that can be imported and used.

Joi To Swagger

Converts Joi Schema to swagger object.

Usage

const swaggerSchema = Utils.JoiToSwagger(joiSchema)

Object Describer

This component creates a swagger schema from one or several connected models. This component can be used to describe the response of APIs.

Usage

const output = new Utils.ObjectDescriber({ schema: User, mask: 'id,firstName,lastName,email'})
  .extend({ key: 'ads', objectModel: { schema: Ad, mask: 'id,category' }, array: true })
  .extend({ key: 'likes', objectModel: { schema: Like, mask: 'id,link' } })
  .join({ key: 'books', objectModel: { schema: Book, mask: 'id,title,author' } })
  .format()

The output will be something like this:

{
  id: { type: 'string' },
  firstName: { type: 'string' },
  lastName: { type: 'string' },
  email: { type: 'string' },
  ads: {
    type: 'array',
    items: {
      id: { type: 'string' },
      category: { type: 'string' }
    }
  },
  likes: {
    id: { type: 'string' },
    link: { type: 'string' }
  },
  books: {
    id: { type: 'string' },
    title: { type: 'string' },
    author: { type: 'string' }
  }
}

If you set the second parameter of the constructor to { array: true }, the output will be in the following format:

{
  type: 'array',
  items: <ITEMS-SCHEMA>
}

Promise Runner

This component receives several async functions and executes all of them and return the response.

Usage

const runner = new Utils.PromiseRunner()

runner.add(async () => {
  const output1 = await task1()
  // ...
})

runner.add(async () => {
  const output2 = await task2()
  // ...
})

await runner.run()

Documentation [NEED TO CREATE and UPDATE]

Link external documents in this section

Support

Please create a task for support.

Contributing

Please contribute using Git Convention. Create a branch, add commits, and create a merge request.