0.2.1 • Published 3 years ago

grow-files v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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

0.2.1

3 years ago

0.2.0

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago