# import .js file

{% tabs %}
{% tab title="💈範例" %}
* replit ⟩ [node ⟩ require](https://replit.com/@pegasusroe/node-require#index.js)

```javascript
const { log } = console;

// ⭐ use "require", not "import" (in Node)
const utils = require('./utils.js');

log(utils.power);         // 9001
log(utils.square(5));     // 25

// ⭐ can also do the same thing like so:
const {power, square} = require('./utils.js');

log(power);               // 9001
log(square(5));           // 25
```

📁 utils.js

```javascript
module.exports = {
    power: 9001,
    square: x => x*x
};
```
{% endtab %}

{% tab title="🗣 討論" %}
* replit ⟩ [Multiple .js files in one project](https://replit.com/talk/ask/Multiple-js-files-in-one-project/15367)
{% endtab %}

{% tab title="👥 相關" %}
* [module](../../../../js/module "mention")
{% endtab %}
{% endtabs %}
