UNPKG

@mannguyen/nestcli

Version:

A CLI to create model

20 lines (15 loc) 405 B
const fs = require("fs"); const { flattenDeep } = require("lodash"); const directory = "./entity.js"; const targetDirectory = process.cwd(); const rows = fs .readFileSync(directory) .toString() .replace(/\r\n/g, "\n") .trim() .split("\n"); for (const [idx, row] of [...rows].entries()) { if (row.indexOf('} from "typeorm"') !== -1) { row.replace("Column", `Column, ManyToMany`); } }