New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rhases-nodejs-commons

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rhases-nodejs-commons - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

package.json
{
"name": "rhases-nodejs-commons",
"version": "0.1.0",
"version": "0.1.1",
"description": "Node.js utilities",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -1,29 +0,42 @@

# Example Typescript 2.x Library
# Node.js Utilities
Simple starter library from June 2017.
Tutorial can be found at
[how-to-write-a-typescript-library.com](http://how-to-write-a-typescript-library.com).
## Installation
Or just browse the code here! Or clone the repo.
Using npm:
```shell
$ npm i --save rhases-nodejs-commons
```
# Usage
## Using
### Pino Log
```js
import l from 'rhases-nodejs-commons';
l.error(err);
l.info("foo", foo);
```
git clone https://github.com/bersling/typescript-library-starter.git
```
### Service Utils
then modify whatever you want, then
```js
import {ServiceUtils} from 'rhases-nodejs-commons';
serviceUtils = new ServiceUtils(MyMongooseModel);
all() {
return this.serviceUtils.all();
}
```
tsc
```
### Controller Utils
You can check if everything is working like this:
http://how-to-write-a-typescript-library.com/local-consumer
```js
import {ControllerUtils} from 'rhases-nodejs-commons';
You can write a test like this:
http://how-to-write-a-typescript-library.com/unit-testing
controllerUtils = new ControllerUtils(MyService);
And once you're ready, simply change the `name` in the `package.json`
and publish your brand new cool library. Have fun!
byId(req, res) {
this.controllerUtils.byId(req, res);
}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc