Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tsuki-lab/grow-files
テンプレート一覧からCLIでファイルを生成する。
https://github.com/tsuki-lab/grow-files
Last synced: 28 days ago
JSON representation
テンプレート一覧からCLIでファイルを生成する。
- Host: GitHub
- URL: https://github.com/tsuki-lab/grow-files
- Owner: tsuki-lab
- License: mit
- Created: 2021-06-08T07:59:55.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-07-06T07:20:55.000Z (over 3 years ago)
- Last Synced: 2024-12-23T11:53:02.465Z (about 1 month ago)
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/grow-files
- Size: 103 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Node.js CLI convert and generate tool for template file 🥂# grow-files
Node.js CLI convert and generate tool for template file
## Usage
### Set up
```bash
npm install -g grow-files
grow-files# Create if not
# ✨ Created TemplatesDir!! Let's create a template in the created directory. - /.grow-files/templates
```Create `template` _HomeDir_/.grow-files/templates
```
┗ .grow-files
┗ templates
┗ module
┗ $FILE_NAME.spec.ts
┗ $FILE_NAME.ts
``````ts
// HomeDir/.grow-files/templates/module/$FILE_NAME.spec.tsimport { $FILE_NAME } from './$FILE_NAME';
describe('Test the $FILE_NAME.', () => {
test('Test the example method response to undefined.', () => {
const resp = $FILE_NAME.example();
expect(resp).toBe(undefined);
});
});
``````ts
// HomeDir/.grow-files/templates/module/$FILE_NAME.ts/**
* class methods name: $FILE_NAME
*
* @export
* @class $FILE_NAME
*/
export class $FILE_NAME {
/**
* example class method
*
* @static
* @memberof $FILE_NAME
*/
public static example() {}
}
```### Execute
```bash
grow-files ./src/modules/StringModule
# grow-files# templates/ 配下に配置したディレクトリの名前一覧が表示されます。
# そのうちの一つを選択します。
? Choose a template.
``````ts
// src/modules/StringModule.spec.tsimport { StringModule } from './StringModule';
describe('Test the StringModule.', () => {
test('Test the example method response to undefined.', () => {
const resp = StringModule.example();
expect(resp).toBe(undefined);
});
});
``````ts
// src/modules/StringModule.ts/**
* class methods name: StringModule
*
* @export
* @class StringModule
*/
export class StringModule {
/**
* example class method
*
* @static
* @memberof StringModule
*/
public static example() {}
}
```## License
MIT License © 2021 hanetsuki