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

tsunamy

v0.0.23

Published

A new typesript framework

Downloads

12

Readme

npm version

Tsunamy framework

a node.ts framework, Alpha version. Make easy to build a REST API server and serve a SPA

Quick Start

go to link and download the project. Write your new routes in src/api/app.controller.ts, run npm run start, it will reload automatically on file change.

Features

project architecture

src
  |-api (contain module, controller and service)
  |-config (contain the server config files)
  |-public (contain all the public files)
  main.ts (bootsrap the module)

if the request starts with /api the app checks the routes in the controller, otherwise, the app serves the static files on the public folder.

supports methods: GET, POST, PUT and DELETE with parameters in the route, query or body.

Example: GET api/custom/url/route/4?queryvar=blabla in the controller

@RequestMapping({ path:"/custom/url/route/{id}", method: 'GET'})
customFunction(@PathParam('id') id: number, @QueryParam('queryvar', {notNull: true}) queryvar: string) {
  return queryvar + id;
}

Function can have this parameters : @PathParam('name') @QueryParam('name') @Body() @Response()

Options can be passed to @QueryParam.

Guards

You can use Guards annotation for do some process fefore the fonction (exemple secure route).

function isAdmin(request){ return true; }

@RequestMapping({ path:"/custom/url/route/{id}", method: 'GET'})
@Guards(isAdmin)
customFunction(@PathParam('id') id: number, @QueryParam('queryvar') queryvar: string) {
  return queryvar + id;
}

Response

You can change the response manually, in the nodejs way.

@RequestMapping({ path:"/custom/url/route/{id}", method: 'GET'})
customFunction(@Response() res: any) {
  res.setHeader('test', 'testValue')
  return '';
}

ResponseEntity

This type is used to http response (http code + body). It's a class with generic body's type.

function getById(id: number){ return new Object(); }

@RequestMapping({ path:"/custom/url/route/{id}", method: 'GET'})
customFunction(@PathParam('id') id: number): Promise<ResponseEntity<Object>> {
  return new ResponseEntity<>(HttpStatus.OK, getById(id));
}

Log

You can log message in console and/or in file. There are 3 levels: INFO, WARN and ERROR

When we log with ERROR level the stack is added to the message.

try {
  Log.Info('My message with INFO level');
  throw new Error()
} catch (e) {
  Log.Err('My message with ERROR level');
}

https

change to https : true in the CONFIGURATION file and add the two file to your projet /certificate/key.pem /certificate/certificate.pem be careful this files are ignored by git (not commit)

Project link here

more feature soon