Initial commit
This commit is contained in:
51
code/templates/module-template.js
Normal file
51
code/templates/module-template.js
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Module Template
|
||||
*
|
||||
* Example of a utility module with multiple exports
|
||||
*/
|
||||
|
||||
/**
|
||||
* Function one
|
||||
* @param {type} param - Description
|
||||
* @returns {type} Description
|
||||
*/
|
||||
export function functionOne(param) {
|
||||
// Implementation
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function two
|
||||
* @param {type} param - Description
|
||||
* @returns {type} Description
|
||||
*/
|
||||
export function functionTwo(param) {
|
||||
// Implementation
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constant export
|
||||
*/
|
||||
export const CONSTANT_VALUE = "value";
|
||||
|
||||
/**
|
||||
* Object export
|
||||
*/
|
||||
export const config = {
|
||||
option1: true,
|
||||
option2: "value",
|
||||
};
|
||||
|
||||
// Default export (optional)
|
||||
export default {
|
||||
functionOne,
|
||||
functionTwo,
|
||||
CONSTANT_VALUE,
|
||||
config,
|
||||
};
|
||||
|
||||
// Usage examples:
|
||||
// import { functionOne, functionTwo } from './module-template.js';
|
||||
// import utils from './module-template.js'; // Default import
|
||||
// import * as utils from './module-template.js'; // Namespace import
|
||||
Reference in New Issue
Block a user