@importable/document

0.1.0 • Public • Published

@importable/document

Importable Document allows you to import documents with strong typing based on import attributes (presently import assertions).

import document from './document.kdl' assert { type: 'document', from: 'kdl' }

console.assert(doc.name === 'html')
console.assert(doc.children[1].name === 'body')

Installation

npm install importable @importable/document
{
  "compilerOptions": {
    "plugins": [
      {
        "name": "importable",
        "plugins": [
          "@importable/document"
        ]
      }
    ]
  }
}

License

Code original to this project is licensed under the CC0-1.0 License.

Package Sidebar

Install

npm i @importable/document

Weekly Downloads

1

Version

0.1.0

License

CC0-1.0

Unpacked Size

3.35 kB

Total Files

3

Last publish

Collaborators

  • jonathantneal