I am creating a javascript module for a firefox extension. I'm curious if the extension makes a difference. In the examples I've seen, it looks like either one is ok and I wanted to make sure.
Thanks
The JSM file type is primarily associated with Gray Design Associates Jigsaws Galore Jigsaw File.
jsm is used to denote that it is a javascript module, like in MrHIDEn's answer. This pertains more to node than to the browser, but . jsm usually means expect import and export keywords.
The NAT-JSM is a flexible testing and diagnostic JTAG Switch Module to accelerate the design, prototyping and operation of your MicroTCA (MTCA) embedded computing system. It provides JTAG vector testing of all slots in a system using just one module.
No difference at all.
I guess it is just convenient to know which files are "modules" at a glance, but anyway there is no such thing as a formal javascript module, it is all convention.
Attention: My answer looks obsolete nowadays.
Mozilla defines .jsm here: JavaScript code modules
In their definition you must define exported vars and functions,var EXPORTED_SYMBOLS = ["foo", "bar"];
Only those will be in the scope.
But I really do not know if this works in HTML pages.
Edited
(Mirror of) JavaScript code modules - color
(Mozilla cach of) JavaScript code modules - old style
As @blaedj mentioned below this would be better answer: JavaScript modules
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With