browserify / browserify/static-module
How about modules which are functions with properties?
- Dominant language
- JavaScript
- Stars
- 75
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
If I have a module `mymodule` which exports a function with properties, as follows:
```
module.exports = function mymodule() { /* ... */ }
module.exports.foo = 1
```
How am I supposed to "statify" it, without choosing whether to restrict my client code to use either the function or the properties?
```
// Case 1: statify the function
staticModule({
mymodule: function () { return '"something"' }
}) // Bad! cannot access require('mymodule').foo
// Case 2: statify the props
staticModule({
mymodule: {
foo: function() { return '1' }
}
}) // Bad! cannot call require('mymodule')()
```
My use case is my project over at fabiosantoscode/require-emscripten, which is a node module exporting a function which also has properties.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.