# @karantickets/common

> Custom NPM module to share common code across all the middlewares. ##### NOTE: Check the package.json file. ``` npm login npm publish --access public ```

Latest version **1.0.12** (published 2020-08-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install @karantickets/common
pnpm add @karantickets/common
yarn add @karantickets/common
bun add @karantickets/common
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.12 |
| Published | 2020-08-03 |
| First published | 2020-07-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 31.7 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | karankumarshreds |

## Links

- npm: https://www.npmjs.com/package/@karantickets/common
- npm.io page: https://npm.io/package/@karantickets/common

## Dependencies (8)

- [express](https://npm.io/package/express.md) ^4.17.1
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.5.1
- [@types/express](https://npm.io/package/@types/express.md) ^4.17.7
- [cookie-session](https://npm.io/package/cookie-session.md) ^1.4.0
- [express-validator](https://npm.io/package/express-validator.md) ^6.6.0
- [@types/jsonwebtoken](https://npm.io/package/@types/jsonwebtoken.md) ^8.5.0
- [node-nats-streaming](https://npm.io/package/node-nats-streaming.md) ^0.3.2
- [@types/cookie-session](https://npm.io/package/@types/cookie-session.md) ^2.0.41

## Recent versions

- 1.0.12 (latest) — 2020-08-03
- 1.0.10 — 2020-08-01
- 1.0.9 — 2020-07-30
- 1.0.8 — 2020-07-26
- 1.0.7 — 2020-07-24
- 1.0.6 — 2020-07-21
- 1.0.5 — 2020-07-19
- 1.0.4 — 2020-07-18
- 1.0.3 — 2020-07-13
- 1.0.2 — 2020-07-09
- 1.0.1 — 2020-07-09
- 1.0.0 — 2020-07-07

## README

##### Common NPM custom registry
Custom NPM module to share common code across all the middlewares.
##### NOTE: 
Check the package.json file.
```
npm login
npm publish --access public
```

These will be written in TS but published in JS.

##### dependencies 
```
npm install typescript del-cli --save-dev
```

##### to convert TS to JS and build the project 
* add this to package.json 
```
"scripts": {
    "clean": "del-cli ./build/*",
    "build": "npm run clean && tsc"
  },
```
* uncomment below lines in tsconfig.json
```
    "declaration": true, /* Generates corresponding '.d.ts' file. */
    "outDir": "./build",
```
* run :
```
npm run build
```
*This will take the TS file we coded, convert it into JS and write it into the build directory*

If we want to publish it, we want to make sure we make changes so that the use/us while importing this module get access to the built file in the build folder instead of the index.js file in the root directory.
Therefore, package.json: 
```javascript
  "main": "./build/index.js", // main file
  "types": "./build/index.d.ts", // main type def file 
  "files": [
    "build/**/*" // files which will be included in the final published module
  ],
```

Further, if you make any changes to the source code and want to patch it as a new version, you can either manually change the version number in the package.json file or simply: 
##### note: *make sure you commit your changes to git first*
```linux
npm version patch
```
*This won't publish it! In order to do so*:
```linux
npm run build 
npm publish
```

---
_Source: https://npm.io/package/@karantickets/common · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
