Skip to content

Instantly share code, notes, and snippets.

@sebastianwahn
Created December 30, 2017 15:24
Show Gist options
  • Save sebastianwahn/03dee056f94c5e61f627b75b301b8c07 to your computer and use it in GitHub Desktop.
Save sebastianwahn/03dee056f94c5e61f627b75b301b8c07 to your computer and use it in GitHub Desktop.
IntelliJ File template for NestJS
#set($parts=$NAME.split('\.') )
#set($rawClassName=$parts.get(0))
#set($firstRawClassNameLetter=$parts.get(0).charAt(0).toString())
#set($firstClassNameLetter=$parts.get(0).charAt(0).toString().toUpperCase())
#set($rawTypeName=$parts.get(1))
#set($firstRawTypeNameLetter=$parts.get(1).charAt(0).toString())
#set($firstTypeNameLetter=$parts.get(1).charAt(0).toString().toUpperCase())
#set($className=$parts.get(0).replaceFirst($firstRawClassNameLetter, $firstClassNameLetter))
#set($typeName=$parts.get(1).replaceFirst($firstRawTypeNameLetter, $firstTypeNameLetter))
import { Component } from '@nestjs/common';
export class ${className}${typeName} {
/**
* ${className}${typeName} class constructor
*/
constructor() {
}
}
@sebastianwahn
Copy link
Author

Import this file template into IntelliJ/PHPStorm/WebStorm and create a file called "some.controller", this template will create a TypeScript class called "SomeController".

Add/Edit/Remove other TypeScript specific things (imports, extends, interface, ..) as you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment