embed-plugin-base

5.0.4 • Public • Published

embed-plugin-base

A plugin that can be used to create custom plugins.

Installation

npm i -S embed-plugin-base

CDN

https://unpkg.com/embed-plugin-base

Usage

Edit embed.js - custom plugin vimeo

This is just a helper plugin that handles text transformation. You may not always need this.

import extend from 'just-extend'
import base from 'embed-plugin-base'
 
/**
  * This function can be used to make any API calls that you want to make  
  * before passing the data to the template.
**/
async function _process() {
  // Do any async task
  return value
}
 
export default function (opts) {
  const defaultOptions = {
    regex: /your_regex/gi,
    async template(args, options, pluginOptions, value) {
      // return the template
    }
  }
 
  const pluginOptions = extend({}, defaultOptions, opts)
  return base(pluginOptions)
}

License

MIT @ Ritesh Kumar

Readme

Keywords

none

Package Sidebar

Install

npm i embed-plugin-base

Weekly Downloads

187

Version

5.0.4

License

MIT

Unpacked Size

52.4 kB

Total Files

12

Last publish

Collaborators

  • ritz078