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

Export an actually working es6 module #4

Merged
merged 1 commit into from
Jan 8, 2021
Merged

Conversation

kapouer
Copy link
Contributor

@kapouer kapouer commented Jan 8, 2021

Fix #3

@kapouer
Copy link
Contributor Author

kapouer commented Jan 8, 2021

This assumes npm run preversion is run from a reasonably bash-compatible shell...

package.json Outdated Show resolved Hide resolved
@miraclx
Copy link
Owner

miraclx commented Jan 8, 2021

lgtm; Thanks for this.

@miraclx miraclx closed this Jan 8, 2021
@miraclx
Copy link
Owner

miraclx commented Jan 8, 2021

Does the readme need an update? https://github.com/miraclx/xbytes#usage

@miraclx miraclx reopened this Jan 8, 2021
@kapouer
Copy link
Contributor Author

kapouer commented Jan 8, 2021

I don't think so - i made it so it doesn't change anything w.r.t. usage.

@miraclx
Copy link
Owner

miraclx commented Jan 8, 2021

Great. All good then.

@miraclx miraclx merged commit d799f65 into miraclx:master Jan 8, 2021
@kapouer
Copy link
Contributor Author

kapouer commented Jan 8, 2021

FYI you can do a test with a test.mjs file (provided node_modules/xbytes is present)

import xbytes from "xbytes"
console.log(xbytes(100000));

then

$ node test.js
(node:710173) ExperimentalWarning: The ESM module loader is experimental.
100.00 KB

(that's with node 12).

miraclx added a commit that referenced this pull request Jan 9, 2021
Node-based impl of #4
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

Successfully merging this pull request may close these issues.

cannot be loaded as a native browser esm
2 participants