open-index/open-npm huggingface dataset:
npm package: @occupop/lib-s3-storage
Description: Tiny S3 storage helper (AWS & LocalStack) with injectable bucket, signed URLs and public URLs.
Author: occupop
Latest version: 1.0.3

# @occupop/lib-s3-storage

Helper minimalista para S3 (AWS e LocalStack).

### Recursos
- URL pré-assinada **PUT**
- URL pré-assinada **GET**
- Upload direto com `putObject` (checksum CRC32)
- Leitura de objeto em **base64** com `getObjectBase64`
- Bucket injetável (por instância ou chamada)
- Suporte a LocalStack e S3 Accelerate

### Instalação

```bash
npm i @occupop/lib-s3-storage @aws-sdk/client-s3 @aws-sdk/s3-request-presigner crc-32
```

### Uso

```ts
import { createS3Storage } from '@occupop/lib-s3-storage'

const storage = createS3Storage({
  region: process.env.AWS_REGION!,
  credentials: {
    accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
    secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
  },
  endpoint: process.env.AWS_S3_ENDPOINT, // LocalStack: "http://localstack:4566"
  defaultBucket: process.env.AWS_S3_BUCKET || 'message',
})

// 1) Signed PUT
const putUrl = await storage.getSignedPutUrl({
  path: 'uuid/file.pdf',
  contentType: 'application/pdf',
})
console.log(putUrl.url)

// 2) Upload direto
const uploaded = await storage.putObject({
  path: 'uuid/file.pdf',
  contentType: 'application/pdf',
  bodyBase64: Buffer.from('conteúdo').toString('base64'),
})
console.log(uploaded.url)

// 3) Signed GET
const getUrl = await storage.getSignedGetUrl({
  path: uploaded.key,
  fileName: 'file.pdf',
  download: true,
})
console.log(getUrl.url)

// 4) Ler objeto e retornar base64
const base64 = await storage.getObjectBase64({
  key: uploaded.key,
})
console.log(base64)
```

### API

```ts
createS3Storage(config: S3StorageConfig): S3Storage
```

`S3Storage` expoe os metodos abaixo:

- `getSignedPutUrl(input: SignedPutInput): Promise<SignedUrlResult>`
  - `input.path` (obrigatorio)
  - `input.bucket?`
  - `input.contentType?`
  - `input.expiresInSeconds?`

- `putObject(input: PutObjectInput): Promise<PutObjectResult>`
  - `input.path` (obrigatorio)
  - `input.contentType` (obrigatorio)
  - `input.bodyBase64` (obrigatorio)
  - `input.bucket?`
  - `input.cacheControl?`

- `getSignedGetUrl(input: SignedGetInput): Promise<SignedUrlResult>`
  - `input.path` (obrigatorio)
  - `input.bucket?`
  - `input.expiresInSeconds?`
  - `input.fileName?`
  - `input.download?`
  - `input.contentType?`

- `getObjectBase64(input: GetObjectBase64Input): Promise<string>`
  - `input.key` (obrigatorio)
  - `input.bucket?`

Retornos:
- `SignedUrlResult`: `{ url, bucket, key, expiresIn }`
- `PutObjectResult`: `{ url, bucket, key }`
npm package: @ocd-sg/ui
Description: Packaged tooling for React & Redux projects
Latest version: 0.2.14
Deprecated: false

# `ui`

Let’s make life better.

`ui` is a packaged front-end tool to:

- scaffold a project
- single source of dependencies
- allow for dependency and boilerplate updates to be applied to multiple projects even after scaffolding

## Usage

```bash
npm install ocd-sg/ui

# list available modules
npx ui list

# initialize a module
npx ui init <react-component|redux-module>

npm run dev
npm run build:app
```