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

eensy

v1.1.7

Published

A ligthweight, opinionated, and easy to use typescript library for microservice backend applications based on express.

Downloads

30

Readme

A ligthweight, opinionated, and easy to use typescript library for microservice backend applications based on express.

class UserController extends Controller {
  async index(req: Request) {
    await IndexValidator(req)
    const all = await userRepository.all()

    return { data: collection(UserTransform, all) }
  }

  async show(req: Request) {
    const validated = await ReferenceValidator(req)
    const user = await userRepository.show(validated.id)
    if (!user) throw ResourceNotFoundError()

    return { data: UserTransform(user) }
  }

  async store(req: Request) {
    const validated = await StoreValidator(req)
    const user = await userRepository.create(validated as User)
    return { status: 201, data: UserTransform(user) }
  }

  async update(req: Request) {
    const validated = await UpdateValidator(req)
    await ExistsValidator(req)

    const user = await userRepository.update(validated.id, validated.fields)
    return { status: 202, data: UserTransform(user) }
  }

  async destroy(req: Request) {
    const validated = await ReferenceValidator(req)
    await ExistsValidator(req)

    await userRepository.delete(validated.id)
    return { status: 202 }
  }
}

Install and use

This library comes with a built-in cli to help you get started.

npm i -g eensy
eensy.cli init

The CLI will promt some questions to generate the base project for you. Once the CLI command has finished, execute the following to start your project:

cd PROJECT_NAME
npm start

More information and guides are included on the generated project's README.md file.

Features

  • ⚙️ Built-in CLI: Uses templates and schematics to greatly speed up development.
  • 🚀 Minimal setup: Requires minimal configuration to start developing features.
  • 🎯 Prisma integration: Built-in integration with Prisma for efficient database development.
  • 🏢 Stable project structure: Provides a well-defined and stable structure for your project.
  • 🔌 Microservice oriented: Encourages the development of microservice oriented applications, providing a simple and easy to use API for inter-service communication via HTTP and queues.
  • 🔒 JWT authentication: Built-in support for JWT authentication.
  • Validator pattern: Out-of-the-box usage of the validator pattern.
  • ➡️ Functional syntax: Functional syntax for declaring routes and middlewar chains.
  • 🧹 Clean and simple syntax: Offers a clean and simple syntax for easy development.
  • Job scheduler: Built-in job scheduler for task management.
  • 🐮 Bull queue integration: Integration with Bull queue for background jobs and distributed processing.
  • 📡 Socket.io integration: High-level API for broadcasting with Socket.io, including built-in support for broadcast channels and personal channels.
  • 💾 Repository pattern: Adoption of the repository pattern for efficient database access.
  • 🔁 Distributed transactions: Built-in support for 2PC (two-phase commit) distributed transactions with utilities for quickly implementing atomic operations.

CLI usage

You can ask for help with:

eensy.cli -h

The CLI currently has 3 generation features: project generation (aka. Init), service generation and resource generation (aka. RESTful entity generation).

Project generation

This command inits a project. Some promts will be shown so that the CLI knows how to generate the best base project.

eensy.cli init

Service generation

This command generates a service inside a project. It will generate all the folder and file structure that you need to start using a new service in your project.

eensy.cli generate:service

Resource generation

This command generates a RESTful resource inside a project. You can select the service that will serve the new resource. You can also choose which parts of the resource files you want to generate, by default the controller, the model, the repository, the REST validators, the routes file, the transform and the testing specs are generated.

eensy.cli generate:resource

About schematics

The built-in CLI of this project uses Angular schematics as the core of file system manipulation. Please show support to the awesome Angular.io community for making such reliable scaffolding library.

Author

👤 Joao Pinto @ neuralgeeks

Show your support

Give a ⭐️ if this project helped you!

🤝 Contributing

Since eensy is a small library, we are not accepting any contributions at the moment. However, you can still contribute by reporting bugs, suggesting features, and sharing your ideas. Issues and pull requests are welcome!

📝 License

Copyright © 2020 neuralgeeks. This project is MIT licensed.