# typescript-cp

> Copy non-typescript files to outDir

Latest version **0.1.11** (published 2026-08-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install typescript-cp
pnpm add typescript-cp
yarn add typescript-cp
bun add typescript-cp
```

Provides the command `tscp`.

## Health

**Score 45/100 (D)** — status: active.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.11 |
| Published | 2026-08-15 |
| First published | 2021-03-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 20 |
| Dependencies | 7 |
| Unpacked size | 106.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 59 |
| Author | Benedek Káldi |
| Maintainers | bencergazda |
| Keywords | typescript, ts, file, asset, copy, watch, watcher, watchfile, fs |

## Links

- npm: https://www.npmjs.com/package/typescript-cp
- Repository: https://github.com/body-builder/typescript-cp
- Homepage: https://github.com/body-builder/typescript-cp#readme
- Issues: https://github.com/body-builder/typescript-cp/issues
- npm.io page: https://npm.io/package/typescript-cp

## Dependencies (7)

- [globby](https://npm.io/package/globby.md) ^11.1.0
- [lodash](https://npm.io/package/lodash.md) ^4.18.1
- [rimraf](https://npm.io/package/rimraf.md) ^6.1.3
- [chokidar](https://npm.io/package/chokidar.md) ^3.5.3
- [fs-extra](https://npm.io/package/fs-extra.md) ^11.1.1
- [commander](https://npm.io/package/commander.md) ^10.0.1
- [cosmiconfig](https://npm.io/package/cosmiconfig.md) ^8.1.3

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.1.11 (latest) — 2026-08-15
- 0.1.10 — 2026-07-24
- 0.1.9 — 2023-07-20
- 0.1.8 — 2023-05-07
- 0.1.7 — 2022-12-14
- 0.1.6 — 2022-07-20
- 0.1.5 — 2021-10-11
- 0.1.4 — 2021-09-09
- 0.1.3 — 2021-08-26
- 0.1.2 — 2021-06-14
- 0.1.0 — 2021-03-29

## README

# Typescript-cp

[![npm version](https://badge.fury.io/js/typescript-cp.svg)](http://badge.fury.io/js/typescript-cp)
[![dependencies Status](https://david-dm.org/body-builder/typescript-cp/status.svg)](https://david-dm.org/body-builder/typescript-cp)
[![devDependencies Status](https://david-dm.org/body-builder/typescript-cp/dev-status.svg)](https://david-dm.org/body-builder/typescript-cp?type=dev)
[![peerDependencies Status](https://david-dm.org/body-builder/typescript-cp/peer-status.svg)](https://david-dm.org/body-builder/typescript-cp?type=peer)

Copy non-typescript files to outDir

## Installation

`$ npm install typescript-cp -D`

## CLI

```shell
# Copy
$ tscp

# Copy for TS project references
$ tscp -b

# Watcher
$ tscp -w

# Watcher for TS project references
$ tscp -b -w

# Custom compiler settings
$ tscp -p tsconfig.production.json

# Help
$ tscp -h
```

## Example

package.json

```json5
{
	//...
	scripts: {
		start: 'tsc -w & tscp -w',
		build: 'tsc && tscp',
	},
	//...
}
```

# Configuration

.tscprc

```json5
{
	ignored_files: ['**/an_ignored_file.ext'], // files not to copy (defaults to `['node_modules']`)
	compiled_files: [], // files compiled by TS (these also get ignored) (defaults to `['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx']`)
	use_ts_exclude: true, // ignore files that are listed in the tsconfig `exclude` array (defaults to `true`)
}
```

# Loaders

You can attach basic loader rules to the files. Loaders accept the actual content of the given file as the first parameter, and must return the content of the output file.

.tscprc.js

```js
const path = require('path');

/**
 * @type {import('typescript-cp/dist/types').Config}
 */
module.exports = {
	rules: [
		{
			test: /\.(scss|sass)$/,
			include: [path.resolve('./file-to-include.css')],
			exclude: (source_path) => {
				return source_path.indexOf('file-to-include.sass') > -1;
			},
			use: [
				{
					loader: (content, meta) => {
						// Do something with `content`

						return content;
					},
				},
			],
		},
	],
};
```

See `Config` and `Rule` types in `src/types.ts` for the complete reference.

## Contribution

`$ pnpm run build`

---

Sponsored by: [SRG Group Kft.](https://srg.hu?en)

---
_Source: https://npm.io/package/typescript-cp · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
