# @astram/node-helper

> Helper functions for Astram throughout all micro services

Latest version **1.2.27** (published 2025-02-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install @astram/node-helper
pnpm add @astram/node-helper
yarn add @astram/node-helper
bun add @astram/node-helper
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.27 |
| Published | 2025-02-24 |
| First published | 2023-10-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 1.4 MB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| Author | Astram-Tech/@Anand-Subhadeep |
| Maintainers | astram |

## Links

- npm: https://www.npmjs.com/package/@astram/node-helper
- npm.io page: https://npm.io/package/@astram/node-helper

## Dependencies (8)

- [pg](https://npm.io/package/pg.md) ^8.11.5
- [uuid](https://npm.io/package/uuid.md) 11.0.5
- [mysql2](https://npm.io/package/mysql2.md) ^3.9.1
- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.1472.0
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^9.0.2
- [node-sql-parser](https://npm.io/package/node-sql-parser.md) ^5.2.0
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.2.2
- [class-transformer](https://npm.io/package/class-transformer.md) ^0.5.1

## Recent versions

- 1.2.27 (latest) — 2025-02-24
- 1.2.26 — 2025-02-18
- 1.2.25 — 2025-02-13
- 1.2.24 — 2025-02-13
- 1.2.23 — 2025-02-12
- 1.2.22 — 2025-02-12
- 1.2.21 — 2025-02-12
- 1.2.20 — 2025-02-12
- 1.2.19 — 2025-02-12
- 1.2.18 — 2025-02-12
- 1.2.17 — 2025-02-12
- 1.2.16 — 2025-02-05
- 1.2.15 — 2025-02-05
- 1.2.14 — 2025-02-05
- 1.2.13 — 2024-11-08
- … 24 more at https://npm.io/package/@astram/node-helper/versions

## README

# Astram Node Helper
All Common Helper Functions will be used using this library

## Installation

Install node-helper using [npm](https://npmjs.org)

```
$ cd <working_directory>
$ npm i @astram/node-helper
```

## Helper Modules
* [S3 Module](##s3-module)

## S3 Module
This module is used to get all tasks related to S3 that includes following functionality

* Upload Files
    - uploadToS3
        + Directly Upload File from local system/server to S3
    - uploadFromBuffer
        + Upload data/content to a file onto S3
    - uploadFromStream
        + Upload using stream
* Get File
    - getAllFiles
        + Get all files of a folder
    - getFileLink
        + Get File as URL from S3 which is signed and will expires by default it is 5mins
    - downloadFromS3
        + Download File from S3 to local system or get content of file
* Check File Existance
    - isFileExist
        + Check whether a file exists corresponding to a bucket or not
* Delete File
    - deleteFile
        + Delete file from S3

### Code Example
```
const { s3 } = require(`@astram/node-helper`);

const bucket = `astram-bucket`;

// check if file exists
const filePath = `test/test.pdf`;
const isFile = await s3.isFileExist(bucket, filePath);

// Get File Link
const filePath = `test/test.pdf`;
const isFile = await s3.getFileLink(bucket, filePath);

...
```

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