52 lines
909 B
JavaScript
52 lines
909 B
JavaScript
/**
|
|
* 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
|