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

Filetype return undefined with .npy file #618

Closed
xanhz opened this issue Dec 19, 2023 · 2 comments
Closed

Filetype return undefined with .npy file #618

xanhz opened this issue Dec 19, 2023 · 2 comments

Comments

@xanhz
Copy link

xanhz commented Dec 19, 2023

.npy file has application/octet-stream mimetype but actually it returns undefined

const { fromFile } = require('file-type');

fromFile('foo.npy').then((filetype) => console.log(filetype?.mime)) // expect application/octet-stream
@Datodia
Copy link

Datodia commented Jan 17, 2024

I have same problem, how to solve it?

@xanhz
Copy link
Author

xanhz commented Jan 17, 2024

I have same problem, how to solve it?
Because .npy files do not have header to use magic number. So to fix this problem I use mime-types to get from file path.

@xanhz xanhz closed this as completed Jan 20, 2024
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

2 participants