🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

combine-source

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

combine-source

[![npm package][npm-img]][npm-url] [![Build Status][build-img]][build-url] [![Downloads][downloads-img]][downloads-url] [![Issues][issues-img]][issues-url] [![Code Coverage][codecov-img]][codecov-url] [![Commitizen Friendly][commitizen-img]][commitizen-ur

latest
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

combine-source

npm package Build Status Downloads Issues Code Coverage Commitizen Friendly

Overview

combine-source is a TypeScript library designed to combine multiple source files and their corresponding source maps into a single file and source map. This is particularly useful for bundling JavaScript/TypeScript projects where maintaining accurate source maps is crucial for debugging.

Features

  • Combine multiple source files into one.
  • Merge source maps to maintain accurate mappings.
  • Supports both CommonJS and ES Module formats.

Installation

To install the dependencies, use yarn:

yarn install combine-source

Or use npm:

npm install combine-source

Usage

Here's an example of how to use the combineSource function:

import { CombineFile, combineSource } from 'combine-source';

const files: CombineFile[] = [
  {
    code: 'console.log("File 1");',
    map: {
      /* source map object for file 1 */
    },
  },
  {
    code: 'console.log("File 2");',
    map: {
      /* source map object for file 2 */
    },
  },
];

const result = combineSource(files);

console.log(result.code); // Combined code
console.log(result.map); // Combined source map

Scripts

  • test: Run tests using Vitest.
  • build: Build the project using tsup.
  • prepublishOnly: Build the project before publishing.

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Contact

For any questions or issues, please open an issue on this repository.

FAQs

Package last updated on 13 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts