# emerald.net

> Node.js package to help you build APIs

Latest version **1.0.0** (published 2023-10-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install emerald.net
pnpm add emerald.net
yarn add emerald.net
bun add emerald.net
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-10-25 |
| First published | 2023-10-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 8 |
| Unpacked size | 32.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | greensky-gs |
| Maintainers | greenskywastaken |

## Links

- npm: https://www.npmjs.com/package/emerald.net
- Repository: https://github.com/Greensky-gs/emeraldnet
- Homepage: https://github.com/Greensky-gs/emeraldnet#readme
- Issues: https://github.com/Greensky-gs/emeraldnet/issues/new
- npm.io page: https://npm.io/package/emerald.net

## Dependencies (8)

- [tsc](https://npm.io/package/tsc.md) ^2.0.4
- [cors](https://npm.io/package/cors.md) ^2.8.5
- [uuid](https://npm.io/package/uuid.md) ^9.0.1
- [mysql](https://npm.io/package/mysql.md) ^2.18.1
- [express](https://npm.io/package/express.md) ^4.18.2
- [request-ip](https://npm.io/package/request-ip.md) ^3.3.0
- [typescript](https://npm.io/package/typescript.md) ^5.2.2
- [body-parser](https://npm.io/package/body-parser.md) ^1.20.2

## Recent versions

- 1.0.0 (latest) — 2023-10-25
- 0.0.1 — 2023-10-24

## README

# Emerald.net

Node.js package to help you build APIs

This package only works with mysql databases

## Documentation

First you want to install the package :

`npm install emerald.net`
`yarn add emerald.net`
`pnpm add emerald.net`

### Get started

Create an Emerald application

```js
const { EmeraldApp } = require('emerald.net');

const app = new EmeraldApp({
    port: '8081',
    mysql: {
        user: 'greensky',
        password: '1324',
        database: 'grensky_api',
        host: '127.0.0.1'
    },
    logs: true,
    hashAlgorithm: 'sha256'
})

app.loginEndpoint('/login', (req, res, reason) => {
    reason.send({
        ok: reason === 'logged',
        reason
    })
})

app.start();
```

#### Starting

Call the start method only when you defined all the routes, statics and methods you need, otherwise the application will start without the routes you defined after

#### Algorithm

You should not change the `hashAlgorithm` property, because if you do, all the hashes in the database will be incorrect and users can't log in anymore

### Users

You can get the users manager by calling the `app.users` property

### Application

As the application uses express, you can of course get the express application

Use `app.app` to define your routes

## Contact

If you need any help or support, contact me via [instagram](https://instagram.com/draverindustries), [discord](https://discord.gg/fHyN5w84g6) or mail : `draver.industries@proton.me`

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