Skip to content

Instantly share code, notes, and snippets.

@Stayl045
Forked from ashx3s/README.md
Created March 17, 2022 14:45
Show Gist options
  • Save Stayl045/b9efe239d57a593f73a33cced8ab88e2 to your computer and use it in GitHub Desktop.
Save Stayl045/b9efe239d57a593f73a33cced8ab88e2 to your computer and use it in GitHub Desktop.

Revisions

  1. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -35,6 +35,7 @@ module.exports = {
    - This is the newer syntax and is focused on modules
    - If you are in a node project, `"type: "module"` should be in your package.json
    - Otherwise you can use this syntax by giving files the `.mjs` file extension
    - Vue and Nuxt use this style of imports

    ### Example (Using .mjs files)

  2. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -51,3 +51,5 @@ export const tasks = [
    // array here
    ]
    ```

    - **note that an array is not necessary, it is just the content type used in these examples**
  3. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -45,3 +45,9 @@ import { tasks } from './taskList.mjs'
    ```

    - export file (tasList.mjs)

    ```
    export const tasks = [
    // array here
    ]
    ```
  4. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -43,3 +43,5 @@ module.exports = {
    ```
    import { tasks } from './taskList.mjs'
    ```

    - export file (tasList.mjs)
  5. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@

    ### Example:

    - In your import file, the syntax would look like this
    - In your import file (script.js)

    ```
    const tasks = require('./taskList.js)
    @@ -38,7 +38,7 @@ module.exports = {

    ### Example (Using .mjs files)

    - import file
    - import file (script.mjs)

    ```
    import { tasks } from './taskList.mjs'
  6. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -37,3 +37,9 @@ module.exports = {
    - Otherwise you can use this syntax by giving files the `.mjs` file extension

    ### Example (Using .mjs files)

    - import file

    ```
    import { tasks } from './taskList.mjs'
    ```
  7. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -35,3 +35,5 @@ module.exports = {
    - This is the newer syntax and is focused on modules
    - If you are in a node project, `"type: "module"` should be in your package.json
    - Otherwise you can use this syntax by giving files the `.mjs` file extension

    ### Example (Using .mjs files)
  8. @ashx3s ashx3s revised this gist Mar 17, 2022. No changes.
  9. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -29,3 +29,9 @@ module.exports = {
    ---

    ## ES6 Syntax

    **import/export**

    - This is the newer syntax and is focused on modules
    - If you are in a node project, `"type: "module"` should be in your package.json
    - Otherwise you can use this syntax by giving files the `.mjs` file extension
  10. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,7 @@

    - This is the older way that node would import files into one another.
    - Use it with normal javascript files. This works whether you have a package.json or not
    - Some node packages may not be compatible with this syntax. But it is still in use

    ### Example:

    @@ -24,3 +25,7 @@ module.exports = {
    ]
    }
    ```

    ---

    ## ES6 Syntax
  11. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@ const tasks = require('./taskList.js)
    ```
    module.exports = {
    tasks: [
    // array here
    // output content here
    ]
    }
    ```
  12. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,8 @@ const tasks = require('./taskList.js)

    ```
    module.exports = {
    tasks: [
    // array here
    ]
    }
    ```
  13. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -18,5 +18,7 @@ const tasks = require('./taskList.js)
    - Your export file would look something like this

    ```
    cons
    module.exports = {
    }
    ```
  14. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -14,3 +14,9 @@
    ```
    const tasks = require('./taskList.js)
    ```

    - Your export file would look something like this

    ```
    cons
    ```
  15. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@

    ### Example:

    - import file
    - In your import file, the syntax would look like this

    ```
    const tasks = require('./taskList.js)
  16. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -6,3 +6,11 @@

    - This is the older way that node would import files into one another.
    - Use it with normal javascript files. This works whether you have a package.json or not

    ### Example:

    - import file

    ```
    const tasks = require('./taskList.js)
    ```
  17. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -5,3 +5,4 @@
    **module.exports/require**

    - This is the older way that node would import files into one another.
    - Use it with normal javascript files. This works whether you have a package.json or not
  18. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,6 @@

    ## Common JS Module System

    ** module.exports/require**
    **module.exports/require**

    - This is the older way that node would import files into one another.
  19. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    # How to import javascript files into one another

    ## Common JS System
    ## Common JS Module System

    ** module.exports/require**

    - This is the older way that node would import files into one another.
  20. @ashx3s ashx3s revised this gist Mar 17, 2022. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,5 @@
    ‎‎​
    # How to import javascript files into one another

    ## Common JS System

    - This is the older way that node would import files into one another.
  21. @ashx3s ashx3s created this gist Mar 17, 2022.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ‎‎​