importable
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Importable

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

import config from './config.yml' assert { type: 'yaml' }

console.assert(config.doe === 'a deer, a female deer')

Internally, Importable treats import assertions as thought they are import attributes, in anticipation of the new import assertions syntax.

Once TypeScript supports import assertions, this plugin will provide an update to support the new syntax.

Installation

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

Plugins

License

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

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i importable

    Weekly Downloads

    120

    Version

    0.1.0

    License

    CC0-1.0

    Unpacked Size

    27.8 kB

    Total Files

    9

    Last publish

    Collaborators

    • jonathantneal