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

@rainbow-o23/n2

v1.0.45

Published

o23 application base

Downloads

460

Readme

Static Badge

Nest

Module Formats

o23/n2

In simple terms, o23/n2 is a tool that publishes a given pipeline as a web application using NestJS. In this module, we handle the following tasks:

  • Registering all pipelines and exposing the specified ones as REST APIs,
  • Redirecting logs to standard web log output,
  • Providing standard error handling, where all errors will be caught and processed uniformly,
  • Providing a health check API and a version API,
  • Providing a standard pipeline invocation API. Please note that this API is fully compatible with all data processing pipelines but not with file processing pipelines.

Request

Support request parsing as following:

  • API path,
  • Method,
  • Request headers,
  • Path parameters,
  • Query string parameters,
  • Files,
  • Json body.

The thing to note is that when multiple types of request data are enabled, o23/n2 will degrade and merge them into a single JSON object, and each part has its own naming conventions as follows:

  • Request headers: headers, or given names,
  • Path parameters: pathParams, or given names,
  • Query string parameters: queryParams, or given names,
  • Files: file for single file, files for multiple files, or given names,
  • Json body: body.

Response

Support response outputs as following:

  • Response headers,
  • File download,
  • Json body.

APIs

Health Check

- URL: /
- Method: Get
- Response: { up: true, message: 'Hello there, I am OK now.' }

App Version

- URL: /version
- Method: Get
- Response: { version: 'UNDOCUMENTED', builtAt: 'UNDOCUMENTED' }

Pipeline Trigger

- URL: /pipeline
- Method: Post
- Request: { code: 'string'; payload: 'any' }
- Response: 'any'

The specific data format for the request payload and response depends on the pipeline that needs to be executed.

Referring to the example in o23/scaffold on how to build an application based on o23/n2, won't go into detail here.

Environment Parameters

| Name | Type | Default Value | Comments | |----------------------------------|---------|--------------------------|-------------------------------------------------| | app.port | number | 3100 | Application server port. | | app.context | string | /o23 | Application api context. | | app.name | string | O23-N99 | Application name. | | app.provider | string | Rainbow Team | Application provider. | | app.version | string | UNDOCUMENTED | Application build version. | | app.built.at | string | UNDOCUMENTED | Application build time. | | app.body.json.max.size | string | 50mb | Request maximum body size, for json body. | | app.body.urlencoded.max.size | string | 50mb | Request maximum body size, for urlencoded body. | | app.cors.enabled | boolean | false | Enable cors. | | app.cors.options | json | | CorsOptions of @nestjs/common. | | logger.file.enabled | boolean | false | Enable file log. | | logger.file.rotate.enabled | boolean | true | Enable rotate file log. | | logger.error.file | string | logs/error-%DATE%.log | Error log file. | | logger.error.level | string | error | Logger level for error log file. | | logger.error.json | boolean | true | Use json format. | | logger.error.date.pattern | string | YYYY-MM-DD | Error log file date pattern. | | logger.error.zipped.archive | boolean | false | Enabled zip for error log file. | | logger.error.max.files | string | 30d | Error log file keeping time. | | logger.error.max.size | string | 10m | Error log file maximum size. | | logger.combined.file | string | logs/combined-%DATE%.log | Standard log file. | | logger.combined.level | string | log | Logger level for standard log file. | | logger.combined.json | boolean | true | Use json format. | | logger.combined.date.pattern | string | YYYY-MM-DD | Standard log file date pattern. | | logger.combined.zipped.archive | boolean | false | Enabled zip for standard log file. | | logger.combined.max.files | string | 7d | Standard log file keeping time. | | logger.combined.max.size | string | 10m | Standard log file maximum size. | | logger.console.enabled | boolean | false | Enable console log. | | logger.console.level | string | debug | Logger level for console log. |