@openinula/babel-api
v1.0.0
Published
A package that encapsulates the babel API for use in the transpiler.
Downloads
5
Readme
@openinlua/babel-api
A package that encapsulates the babel API for use in the transpiler.
To implement the dependency injection pattern, the package exports a function that registers the babel API in the transpiler.
import { registerBabelAPI } from '@openinlua/babel-api';
function plugin(api: typeof babel) {
registerBabelAPI(api);
// Your babel plugin code here.
}
And then you can import to use it.
types can use as a
type
or as anamespace
for the babel API.
import { types as t } from '@openinlua/babel-api';
t.isIdentifier(node as t.Node);