I have organized some functions in a file within a node module structure...
Here are the files and folder structure I created:
- package.json
- README.md
- LICENSE.md
- code
|_______ code.js
Currently, to use these functions, I include them like this:
- index.html
<script src="_node_modules/myexamplemodule/code/code.js"></script>
However, I would prefer to be able to import the module like so:
import myexamplemodule from 'myexamplemodule';
What changes should I make to my example module to achieve this?
Note: The code.js file contains functions but is not set up as a module.