# command-file-system

> Cli tool for automatic file and catalogs generation based on given template

Latest version **0.0.10-alpha.1.0** (published 2024-02-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install command-file-system
pnpm add command-file-system
yarn add command-file-system
bun add command-file-system
```

Provides the command `cfs`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.10-alpha.1.0 |
| Published | 2024-02-11 |
| First published | 2023-12-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 24.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | jacob_kalabanga |

## Links

- npm: https://www.npmjs.com/package/command-file-system
- Repository: https://github.com/JakubPilkowski/command-file-system
- Homepage: https://github.com/JakubPilkowski/command-file-system#readme
- Issues: https://github.com/JakubPilkowski/command-file-system/issues
- npm.io page: https://npm.io/package/command-file-system

## Dependencies (4)

- [glob](https://npm.io/package/glob.md) ^10.3.10
- [chalk](https://npm.io/package/chalk.md) ^5.2.0
- [yargs](https://npm.io/package/yargs.md) ^17.6.2
- [file-system-cache](https://npm.io/package/file-system-cache.md) ^2.4.4

## Recent versions

- 0.0.10-alpha.1.0 (latest) — 2024-02-11
- 0.0.9-alpha.1.0 — 2024-02-11
- 0.0.8 — 2024-02-11
- 0.0.8-alpha.1.0 — 2024-02-11
- 0.0.7 — 2024-01-02
- 0.0.7-rc.1.0 — 2024-01-02
- 0.0.6 — 2024-01-02
- 0.0.6-rc.1.0 — 2024-01-02
- 0.0.5 — 2024-01-02
- 0.0.5-rc.1.0 — 2024-01-02
- 0.0.4 — 2024-01-01
- 0.0.4-rc.1.1 — 2024-01-01
- 0.0.4-rc.1.0 — 2023-12-31
- 0.0.3 — 2023-12-30
- 0.0.3-rc.2.0 — 2023-12-30
- … 2 more at https://npm.io/package/command-file-system/versions

## README

# Command File System

Cli tool for creating files based on given templates.

# Warning!!!

This library is in development stage and does not cover most of expected features

## Usage

To start work with `cfs` you need to provide set of templates you want `cfs` to generate for you.

In order to manage `cfs` templates create `cfs.config.js` or `cfs.config.cjs` file.

#### Example - es module - cfs.config.js

```
const indexTemplate = `import {{name}} from './{{name}}{{ext}}';
export default {{name}};
`;

/** @type {import('command-file-system').IConfig} */
export default {
  templates: [
    {
      templateName: "index",
      templateAliases: ["i", "idx", "id"],
      template: indexTemplate,
    },
  ],
};
```

#### Example - commonjs - cfs.config.cjs

```
const indexTemplate = `import {{name}} from './{{name}}{{ext}}';
export default {{name}};
`;

/** @type {import('command-file-system').IConfig} */
module.exports = {
  templates: [
    {
      templateName: "index",
      templateAliases: ["i", "idx", "id"],
      template: indexTemplate,
    },
  ],
};
```

Right now you can easily generate your first template!

## File Generator

In order to generate your template file you need run command:

```
cfs generate-file <TEMPLATE_NAME> <TEMPLATE_ARGS>
```

For example, the output for:

```
cfs generate-file index testIndex.ts
```

should look like this:

```
import index from './testIndex.ts';

export default testIndex;
```

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