# 加载插件 (NodeJS)

URL: https://caijiao.org/dayjs/plugin/plugin
Source: docs/dayjs/plugin/plugin.md
Description: 按需加载 NodeJS 插件示例，使用 'require' 或 ES2015 的 'import' 方法，然后通过 'dayjs.extend' 使用插件。

按需加载插件。

```javascript
var AdvancedFormat = require("dayjs/plugin/advancedFormat");
// import AdvancedFormat from 'dayjs/plugin/advancedFormat' // ES 2015

dayjs.extend(AdvancedFormat); // use plugin
```
