1[](https://www.npmjs.org/package/byte-size) 2[](https://www.npmjs.org/package/byte-size) 3[](https://travis-ci.org/75lb/byte-size) 4[](https://coveralls.io/github/75lb/byte-size?branch=master) 5[](https://david-dm.org/75lb/byte-size) 6[](https://github.com/feross/standard) 7 8{{>main}} 9 10### Load anywhere 11 12This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation. 13 14Node.js: 15 16```js 17const byteSize = require('byte-size') 18``` 19 20Within Node.js with ECMAScript Module support enabled: 21 22```js 23import byteSize from 'byte-size' 24``` 25 26Within a modern browser ECMAScript Module: 27 28```js 29import byteSize from './node_modules/byte-size/index.mjs' 30``` 31 32Old browser (adds `window.byteSize`): 33 34```html 35<script nomodule src="./node_modules/byte-size/dist/index.js"></script> 36``` 37 38* * * 39 40© 2014-18 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown). 41