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

at-nestjs-core

v1.0.24

Published

Core module to help you build great microservices.

Downloads

34

Readme

Feina Activa

at-nestjs-core

Description

Core module to help you build great microservices.

Built With

  • NestJs (4.6) [ common, core, microservices, testing and websockets ]
  • @types [ mongoose ]
  • Autobind decorator
  • json-webtoken
  • kafka-node
  • lodash
  • md5
  • moment
  • mongoose
  • reflect-metadata
  • Rxjs
  • Winston

  • @types [ node ]
  • rimraf
  • TypeScript (2.6.2)
  • Karma [ chrome-launcher, cli, coverage-istanbul-reporter, jasmine and jasmine-html-reporter ]
  • TsLint (5.4.3) [ tslint-eslint-rules and no-unused-expression-chai]
  • Nodemon (automatic reloading)

General info about the stack used within this microservice:

  1. NestJs framework.
  2. TypeScript language.
  3. TSLint core rules
  4. Nodemon is a utility that will monitor for any changes un your source and automatically restart your server.
  • Check annex section for in depth details about our Stack.

Configuration

These instructions will get you a built version of at-nestj-core library, providing a set of classes and tools to ease your microservice development.

Prerequisites

Make sure you have

  1. npm

  2. node version >= 8.9.x,

  3. mongo version >= 3.4.x,installed on your system.

Environments

Environment variables

There are several configurable variables in .env:

APP_NAME='My Microservice'

JWT_SECRET_KEY='supersecretkey'

COOKIE_NAME='cookie_field'

MONGO_DB_URI=<string, mongodb uri>

PORT='9000'

TRANSLATE_HOST='http://localhost:9001'
      
DEFAULT_LANG='ca'

Npm Tasks

Following, we have some package scripts to perform this actions:

  • Start project for development purposes.
  • Run TSLint.
  • Compile TypeScript.
  • Build project in dist folder.
  • Create a server to work with.
  • Watch for file changes and reloads the server.
  • Prepare code during publish process.

Commands:

npm start

npm run lint

npm run build

npm run prepare

npm run clean

Development

Installing and Running

For installing on a project, you just need to install the dependency and start the project.

  1. npm install at-nestjs-core

  2. npm start

Contributing

For development purposes,

  1. Is not recommended to use npm link to test development versions on your projects. We suggest you to generate a built version with:
tsc

and copy these generated files into your microservice dependencies folder npm_modules/at-nestjs-core, replacing published files. After this, you only need to restart your microservice.

You can also use

npm start

script to generate built files on every code update.

Running the tests

To run the tests, you need to type

npm tests

This will execute all the unit tests and create a coverage report of the code.

Publishing new version

To create a new version of this library, you need to upgrade the version field on package.json (check package-lock too), login on your cli as npm owner and type:

npm publish

ANNEX

Folder structure

Creates a ready-to-run microservice with the following directories structure:

.
├── src          # Contains files and directories. Core classes to build a microservice.
├.editorconfig
├.gitignore
├.npmignore
├README.md
└──

Built with

1. NestJS

What is it?

NestJS aims to provide an application architecture out of the box which allows for effortless creation of highly testable, scalable, loosely coupled and easily maintainable applications.

  • Nestjs is a progressive Node.js framework.
  • Is built with TypeScript (preserves compatibility with pure Javascript).
  • Combines elements of OOP ( Object Oriented Programming ), FP ( Functional Programming ) and FRP ( Functional Reactive Programming ).
  • Makes use of Expres.js.

2. TypeScript

What is it?

TypeScript is a typed superset of JavaScript that compiles to plain JavaScript.

  • In this project, Typescript tools are available via npm (Node.js package manager).
  • Use .ts extension in order to indicate that a file will contain code written in TypeScript.

3. Nodemon

Nodemon is a utility that will monitor for any changes on your source code and automatically restart your server.

What it does?
  • Automatic restarting of application.
  • Detects default extension to monitor.
  • Ignores specific files or directories.
  • Watches specific directories.

Altran - 2017