@ptkdev/node-module-boilerplate
Version:
Create your npm library with this user friendly boilerplate. Use this respository as template for your new node library/module
44 lines (43 loc) • 1.09 kB
TypeScript
/**
* Node Module
* =====================
*
* Show hello world text
*
* @contributors: Patryk Rzucidło [@ptkdev] <support@ptkdev.io> (https://ptk.dev)
*
* @license: MIT License
*
*/
import type { ModuleInterface, ModuleResponseInterface } from "../types/module.interfaces";
/**
* Hello World
* =====================
*
* Print hello-world
*
* @interface [ModuleInterface ModuleResponseInterface](https://github.com/ptkdev-boilerplate/node-module-boilerplate/blob/main/app/types/module.interfaces.ts)
*
* @param {string} {text} - input string
*
* @return {Promise<ModuleResponseInterface>} (async) app() function that return string
*
* @example
* 1. In your node project run: `npm install @ptkdev/node-module-boilerplate@latest --save`
* 2. Usage (async):
*
* ```typescript
* import m from "@ptkdev/node-module-boilerplate";
*
* (async () => {
* const { app } = await m({ text: "hello-world" });
*
* console.log(app());
* })();
*
* ```
*
*/
declare const m: ({ text }: ModuleInterface) => Promise<ModuleResponseInterface>;
export { m };
export default m;