# @cfntickets/common

> Create a package.json file:

Latest version **1.0.12** (published 2021-04-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install @cfntickets/common
pnpm add @cfntickets/common
yarn add @cfntickets/common
bun add @cfntickets/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 | 2021-04-21 |
| First published | 2021-03-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 21.8 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | carlosfn224 |

## Links

- npm: https://www.npmjs.com/package/@cfntickets/common
- npm.io page: https://npm.io/package/@cfntickets/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.11
- [cookie-session](https://npm.io/package/cookie-session.md) ^1.4.0
- [express-validator](https://npm.io/package/express-validator.md) ^6.10.0
- [@types/jsonwebtoken](https://npm.io/package/@types/jsonwebtoken.md) ^8.5.1
- [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.42

## Recent versions

- 1.0.12 (latest) — 2021-04-21
- 1.0.10 — 2021-04-21
- 1.0.8 — 2021-04-06
- 1.0.7 — 2021-03-26
- 1.0.6 — 2021-03-26
- 1.0.5 — 2021-03-24
- 1.0.4 — 2021-03-24
- 1.0.3 — 2021-03-24
- 1.0.1 — 2021-03-24
- 1.0.0 — 2021-03-24

## README

#### Initial Setup
Create a package.json file:

    npm init -y

Update name of the package to: @cfntickets/common.

In order to publish a package, it has to be initialized and commited to git

    git init && git add . && git commit -m "initial commit"

Login to npm:

    npm login

Publish package to the organization:

    npm publish --access public

Generate a TS config file:

    tsc --init
    
Install initial dependencies (just for dev):

    npm i typescript del-cli --save-dev
    
Add follow-up scripts to package.json to compile typescript code into JS and to clean build folder when trying to rebuild the project:

```json
{
  "clean": "del ./build/*",
  "build": "tsc"
}
```

Uncomment and update these lines in tsconfig.json file: 
* "declaration": true, 
* "outDir": "./build"

Update package.json to set main file source, main def type file and what files should be included in the final published version of the package:

```json
{
  "main": "./build/index.js",
  "types": "./build/index.d.ts",
  "files": [
    "build/**/*"
  ],
}
```

Add .gitignore file to avoid commiting to git folders:
* build
* node_modules

To publish a change, commit the changes:

    git add . && git commit -m \"Updates\"

And update the package version (check [semantic versioning](https://semver.org/) for details):

    npm version patch

Then, rebuild the project:

    npm run build

And finally we can publish:

    npm publish

NOTE: Don't forget to install the rest of the dependencies needed for the package to work.

    npm i express express-validator cookie-session jsonwebtoken @types/cookie-session @types/express @types/jsonwebtoken

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