npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

concat-ts

v0.0.8

Published

Simple CLI tool to concats exported typescript files.

Downloads

10

Readme

concat-ts

A simple CLI tool to concatenate exported TypeScript files.

Description

concat-ts is a command-line utility that processes TypeScript files, concatenating them while preserving their export order. It simplifies the process of merging exported TypeScript files into a single output file, making it easier to manage and share code.

Features

Concatenates TypeScript files in topological order based on their exports. Removes import declarations from the output file. Easy to integrate into your build process

Installation

Install concat-ts as a global package:

npm install -g concat-ts

Or, add it as a dependency to your project:

npm install concat-ts --save-dev

Usage

Command Line

concat-ts -i <input_entry_path> -o <output_path>
  • -i, --input : Input entry path (required)
  • -o, --output : Output path (required)

Programmatically

import { concatTs } from "concat-ts";

concatTs({
  input: "path/to/input/entry.ts",
  output: "path/to/output/file.ts",
});

Example Given the following TypeScript files:

index.ts

export { default as Foo } from "./Foo";
export { default as Bar } from "./Bar";

Foo.ts

export default class Foo {
  // ...
}

Bar.ts

export default class Bar {
  // ...
}

Running the command:

concat-ts -i index.ts -o output.ts

Will produce the following concatenated output file:

output.ts

export default class Foo {
  // ...
}

export default class Bar {
  // ...
}

As you can see this is a simple concat and things such as the default exports will not be fixed. That being said, the files are topologically imported.

License

MIT License

Development

dev

npm run dev

Runs the CLI application.

You can pass arguments to your application by running npm run dev -- --your-argument. The extra -- is so that your arguments are passed to your CLI application, and not npm.

clean

npm run clean

Removes any built code and any built executables.

build

npm run build

Cleans, then builds the TypeScript code.

Your built code will be in the ./dist/ directory.

test

npm run test

Cleans, then builds, and tests the built code.

bundle

npm run bundle

Cleans, then builds, then bundles into native executables for Windows, Mac, and Linux.

Your shareable executables will be in the ./exec/ directory.