JSPM

transforma

1.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q14762F
  • License MIT

Transform files with simple JavaScript - no setup required

Package Exports

  • transforma
  • transforma/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (transforma) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

🔄 Transforma

Effortless Data Transformation with JavaScript

npm GitHub license

🚀 What is Transforma?

Transforma simplifies data processing by applying JavaScript functions to JSON/CSV files. It skips files that have already been processed, saving time and resources.

⚡ Quick Start

# Install
npm install -g transforma

# Create a project
transforma create my-project

📥 Input Example

Place JSON files inside my-project/data/input/.

Single JSON File (data/input/user.json)

{
  "id": 1,
  "name": "John Doe",
  "email": "john@example.com"
}

Multiple JSON Files (data/input/)

  • data/input/user1.json
    {"id": 1, "name": "Alice"}
  • data/input/user2.json
    {"id": 2, "name": "Bob"}

✍️ Define Your Transformation

Edit my-project/transform.ts:

function transform(data) {
  return {
    ...data,
    processedAt: new Date().toISOString()
  };
}

▶️ Run Transformation

transforma run my-project

📤 Output Example

Processed files appear in my-project/data/output/.

Output for Single JSON (data/output/user.json)

{
  "id": 1,
  "name": "John Doe",
  "email": "john@example.com",
  "processedAt": "2025-03-29T12:00:00.000Z"
}

Output for Multiple JSONs (data/output/)

  • data/output/user1.json
    {"id": 1, "name": "Alice", "processedAt": "2025-03-29T12:00:00.000Z"}
  • data/output/user2.json
    {"id": 2, "name": "Bob", "processedAt": "2025-03-29T12:00:00.000Z"}

📂 Project Structure

my-project/
├── data/
│   ├── input/      # Source files
│   └── output/     # Processed files
├── transform.ts    # Your transformation logic
└── config.json     # Optional settings

🔧 Key Features

  • Fast & Simple: No setup, just write JavaScript.
  • Skip Processed Files: Avoid redundant work.
  • Batch Processing: Handle large datasets efficiently.
  • Flexible Pipelines: Chain multiple transformation steps.

⏭️ Next Steps

  • Add more transformations in transform.ts
  • Customize config.json for multi-step processing
  • Use transforma run my-project --force to reprocess all files

📄 License

MIT