TypeNexus is a great tool for API encapsulation and management. It offers a clean and lightweight way to bundle TypeORM + Expressjs functionality, helping you to build applications faster while reducing template code redundancy and type conversion work.
MIT License
Bot releases are visible (Hide)
Documentation v0.5.4: https://raw.githack.com/jaywcjlove/typenexus/ed7a9a9/index.html
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.5.3...v0.5.4
Published by github-actions[bot] 11 months ago
Documentation v0.5.3: https://raw.githack.com/jaywcjlove/typenexus/513ed5a/index.html
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.5.2...v0.5.3
Published by github-actions[bot] about 1 year ago
Documentation v0.5.2: https://raw.githack.com/jaywcjlove/typenexus/2cabd6a/index.html
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.5.1...v0.5.2
Published by github-actions[bot] over 1 year ago
Documentation v0.5.1: https://raw.githack.com/jaywcjlove/typenexus/7471f66/index.html
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.5.0...v0.5.1
README-zh.md
. 2bd8afa @jaywcjlovePublished by github-actions[bot] over 1 year ago
Documentation v0.5.0: https://raw.githack.com/jaywcjlove/typenexus/4cb2e14/index.html
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.4.1...v0.5.0
To inject uploaded file, use @UploadedFile
decorator:
@Post("/file")
saveFile(@UploadedFile("fileName") file: Express.Multer.File) {}
To inject uploaded multiple files, use the @UploadedFiles
decorator:
@Post("/files")
saveFiles(@UploadedFiles("fileName") file: Express.Multer.File[]) {}
You can also specify uploading options to multer
this way:
import type { Options } from 'multer';
// to keep code clean better to extract this function into separate file
const fileUploadOptions: () => Options = () => ({
storage: multerFn.diskStorage({
destination: (req, file, cb) => {
//...
},
filename: (req, file, cb) => {
//...
}
}),
fileFilter: (req, file, cb) => {
//...
},
limits: {
fieldNameSize: 255,
fileSize: 1024 * 1024 * 2
}
});
// use options this way:
@Post("/file")
saveFiles(@UploadedFile("fileName", fileUploadOptions) file: Express.Multer.File) {}
To inject all uploaded files use @UploadedFiles
decorator instead. typenexus uses multer
to handle file uploads.
Published by github-actions[bot] over 1 year ago
Documentation v0.4.1: https://raw.githack.com/jaywcjlove/typenexus/16dfdb3/index.html
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.4.0...v0.4.1
Published by github-actions[bot] over 1 year ago
Documentation v0.4.0: https://raw.githack.com/jaywcjlove/typenexus/8983f54/index.html
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.3.1...v0.4.0
@DSource()
decorator injects you a DataSource object.
Support constructor @DSource()
decorator
import { Controller, Get, DSource, DataSource } from 'typenexus';
import { Response, Request }from 'express';
import { User } from '../entity/User.js';
@Controller('/users')
export class UserController {
constructor(@DSource() private dataSource: DataSource) {}
@ContentType('application/json')
@Get() // => GET /users
public async getUsers(): Promise<User[]> {
return this.dataSource.manager.find(User);
}
}
Published by github-actions[bot] over 1 year ago
Documentation v0.3.1: https://raw.githack.com/jaywcjlove/typenexus/81adcda/index.html
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.3.0...v0.3.1
Published by github-actions[bot] over 1 year ago
Documentation v0.3.0: https://raw.githack.com/jaywcjlove/typenexus/d362f7a/index.html
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.2.0...v0.3.0
Published by github-actions[bot] over 1 year ago
Documentation v0.2.0: https://raw.githack.com/jaywcjlove/typenexus/5571337/index.html
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.1.0...v0.2.0
Published by github-actions[bot] over 1 year ago
Documentation v0.1.0: https://raw.githack.com/jaywcjlove/typenexus/19e36e5/index.html
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.0.11...v0.1.0
Published by github-actions[bot] over 1 year ago
Documentation v0.0.11: https://raw.githack.com/jaywcjlove/typenexus/de736b2/index.html
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.0.10...v0.0.11
Published by github-actions[bot] over 1 year ago
Documentation v0.0.10: https://raw.githack.com/jaywcjlove/typenexus/5de2a4d/index.html
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.0.9...v0.0.10
Published by github-actions[bot] over 1 year ago
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.0.8...v0.0.9
Published by github-actions[bot] over 1 year ago
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.0.7...v0.0.8
Published by github-actions[bot] over 1 year ago
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.0.6...v0.0.7
Published by github-actions[bot] over 1 year ago
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.0.5...v0.0.6
Published by github-actions[bot] over 1 year ago
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.0.4...v0.0.5
Published by github-actions[bot] over 1 year ago
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.0.3...v0.0.4
Published by github-actions[bot] over 1 year ago
npm i [email protected]
https://github.com/jaywcjlove/typenexus/compare/v0.0.2...v0.0.3