Protect your apps from supply chain attacksInstall
Detect if a Buffer is utf8 encoded. It need The minimum amount of bytes is 4.
var fs = require('fs'); var isUtf8 = require('is-utf8'); var ansi = fs.readFileSync('ansi.txt'); var utf8 = fs.readFileSync('utf8.txt'); console.log('ansi.txt is utf8: '+isUtf8(ansi)); //false console.log('utf8.txt is utf8: '+isUtf8(utf8)); //true
Detect if a buffer is utf8 encoded.
The npm package is-utf8 receives a total of 5,834,980 weekly downloads. As such, is-utf8 popularity was classified as popular.
We found that is-utf8 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.