npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dien-cg

v0.3.5

Published

code generator

Downloads

367

Readme

코드 생성기

해당 모듈은 생산성을 높히기 위해서 만든 코드 생성기 입니다.

dien.config.json

실행시키는 위치에 dien.config.json 파일을 만들어야 됩니다.

| 필드 | 설명 | |--------------|------------------------------------------------------------| | type | api, web 중 하나를 선택 | | database | 데이터베이스 정보 | | templatePath | 템플릿 만들어서 out하는 폴더 경로. ex) "templates", "src/templates" etc | | templates | 템플릿들이 있는 경로 아래의 예제를 봐주세요. key는 그 경로에 파일명에 맞게 처리 함 |

예시는 아래와 같습니다.

{
  "type": "api",
  "database": {
    "host": "",
    "database": "",
    "user": "",
    "password": "",
    "port": 3306
  },
  "outTemplatePath": "templates",
  "templates": {
    "service/{camelTableName}.service.ts": "temps/service.template.ejs",
    "controllers/{camelTableName}.controller.ts": "temps/controller.template.ejs",
    "service/{camelTableName}.dao.ts": "temps/dao.template.ejs",
    "controllers/{camelTableName}.validator.ts": "temps/validator.template.ejs",
    "http/{camelTableName}.http": "temps/http.template.ejs"
  }
}

템플릿

템플릿은 ejs를 기반으로 만들어졌습니다. ejs에 대한 자세한 내용은 ejs를 참고해주세요.

템플릿를 만들 때 여기를 참고해주세요.

변수명

| 이름 | 설명 | |----------------|----------------------| | tableName | 테이블 이름 | | tableComment | 테이블 Comment | | camelTableName | 테이블 이름을 카멜케이스로 변경처리 것 | | columnSchemas | 테이블의 컬럼들에 대한 스키마 입니다. |

columnSchemas types

type columnSchemas = SchemaInterface[];

interface SchemaInterface {
	column: {
		name: string;
		type: string;
		key: string;
		null: string;
		extra: string;
		comment: string;
	};
	field: string;
	type: string;
	ableNull: boolean;
	primaryKey: boolean;
	autoIncrement: boolean;
	isDate: boolean;
	hasDefault: boolean;
	comment: string;
}