grow-files

<br> <p align="center"> <b>Node.js CLI convert and generate tool for template file ๐Ÿฅ‚</b> </p>

Usage no npm install needed!

<script type="module">
  import growFiles from 'https://cdn.skypack.dev/grow-files';
</script>

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

npm install -g grow-files
grow-files <path>

# Create if not
# โœจ  Created TemplatesDir!! Let's create a template in the created directory. - <HomeDir>/.grow-files/templates

Create template HomeDir/.grow-files/templates

<HomeDir>
โ”— .grow-files
  โ”— templates
    โ”— module
      โ”— $FILE_NAME.spec.ts
      โ”— $FILE_NAME.ts
// HomeDir/.grow-files/templates/module/$FILE_NAME.spec.ts

import { $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);
  });
});
// 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

grow-files ./src/modules/StringModule
# grow-files <path>

# templates/ ้…ไธ‹ใซ้…็ฝฎใ—ใŸใƒ‡ใ‚ฃใƒฌใ‚ฏใƒˆใƒชใฎๅๅ‰ไธ€่ฆงใŒ่กจ็คบใ•ใ‚Œใพใ™ใ€‚
# ใใฎใ†ใกใฎไธ€ใคใ‚’้ธๆŠžใ—ใพใ™ใ€‚
? Choose a template.
// src/modules/StringModule.spec.ts

import { StringModule } from './StringModule';

describe('Test the StringModule.', () => {
  test('Test the example method response to undefined.', () => {
    const resp = StringModule.example();
    expect(resp).toBe(undefined);
  });
});
// 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