cem-plugin-async-function
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

cem-plugin-async-function

Adds (non-standard) "async" flag to functions and class methods

Example

custom-elements-manifest.config.js

import { asyncFunctionPlugin } from 'cem-plugin-async-function';

export default {
  plugins: [
    asyncFunctionPlugin(),
  ]
}

async-function.ts

/** @element async-method */
export class Async {
  async a() {}
}

export async function b() {}

Output

{
  "schemaVersion": "1.0.0",
  "readme": "",
  "modules": [
    {
      "kind": "javascript-module",
      "path": "async-function.js",
      "declarations": [
        {
          "kind": "class",
          "description": "",
          "name": "Async",
          "members": [
            {
              "kind": "method",
              "name": "a",
              "async": true
            }
          ],
          "tagName": "async-method",
          "customElement": true
        },
        {
          "kind": "function",
          "name": "b",
          "async": true
        }
      ],
      "exports": [
        {
          "kind": "js",
          "name": "Async",
          "declaration": {
            "name": "Async",
            "module": "async-function.js"
          }
        },
        {
          "kind": "js",
          "name": "b",
          "declaration": {
            "name": "b",
            "module": "async-function.js"
          }
        }
      ]
    }
  ]
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.5
    69
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.5
    69
  • 0.0.4
    0
  • 0.0.3
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i cem-plugin-async-function

Weekly Downloads

69

Version

0.0.5

License

MIT

Unpacked Size

4.1 kB

Total Files

4

Last publish

Collaborators

  • bennyp