Last active
          December 16, 2021 16:32 
        
      - 
      
- 
        Save mitchallen/7e3674c2b68a76f563b6fc94e77b7a51 to your computer and use it in GitHub Desktop. 
    How to Create a JavaScript Module (NodeJS, Browser) (scriptable.com)
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // Insert into my-mod.js above default export | |
| export function makeObject(options = {}) { | |
| let { | |
| name = 'Robbie' | |
| } = options; | |
| function hello() { | |
| console.log(`My name is ${name}`); | |
| } | |
| return { | |
| hello, | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment