importable
v0.1.0
Published
Import files with strong typing based on import attributes
Downloads
765
Maintainers
Readme
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
- Importable Document allows you to import documents from different files.
- Importable Machine allows you to import state machines from different files.
- Importable YAML allows you to import data from YAML files.
License
Code original to this project is licensed under the CC0-1.0 License.