UMD

UMD

A UMD module is one that can either be used as module (through an import), or as a global (when run in an environment without a module loader). Many popular libraries, such as Moment.js, are written this way. For example, in Node.js or using RequireJS, you would write:

1
2
import moment = require("moment");
console.log(moment.format());

whereas in a vanilla browser environment you would write:

1
console.log(moment.format());
doc_TypeScript
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.