Security News
New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
concat-ts
Advanced tools
Readme
A simple CLI tool to concatenate exported TypeScript files.
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.
Concatenates TypeScript files in topological order based on their exports. Removes import declarations from the output file. Easy to integrate into your build process
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
Command Line
concat-ts -i <input_entry_path> -o <output_path>
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.
MIT License
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
.
npm run clean
Removes any built code and any built executables.
npm run build
Cleans, then builds the TypeScript code.
Your built code will be in the ./dist/
directory.
npm run test
Cleans, then builds, and tests the built code.
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.
FAQs
Simple CLI tool to concats exported typescript files.
The npm package concat-ts receives a total of 0 weekly downloads. As such, concat-ts popularity was classified as not popular.
We found that concat-ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
Security News
Results from the 2023 State of JavaScript Survey highlight key trends, including Vite's dominance, rising TypeScript adoption, and the enduring popularity of React. Discover more insights on developer preferences and technology usage.
Security News
The US Justice Department has penalized two consulting firms $11.3 million for failing to meet cybersecurity requirements on federally funded projects, emphasizing strict enforcement to protect sensitive government data.