Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Add import example for ES Modules #12

Open
owen-calico opened this issue Jul 26, 2021 · 0 comments
Open

Suggestion: Add import example for ES Modules #12

owen-calico opened this issue Jul 26, 2021 · 0 comments

Comments

@owen-calico
Copy link

owen-calico commented Jul 26, 2021

The README example for hooking this up uses require(), which some tooling doesn't like.
The following works for me using the import syntax:

import _ from "lodash"
import inflection from "lodash-inflection"
_.mixin(inflection)

You might consider adding this as alternative setup example.

Note that in typescript you'll have to @ts-ignore the import -- unless there's typescript bindings for the inflection functions somewhere, I couldn't find them on Definitively Typed. So that would be:

import _ from "lodash"
// @ts-ignore
import inflection from "lodash-inflection"
_.mixin(inflection)

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant