Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

utf8

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

utf8 - npm Package Compare versions

Comparing version 2.1.2 to 3.0.0

15

package.json
{
"name": "utf8",
"version": "2.1.2",
"version": "3.0.0",
"description": "A well-tested UTF-8 encoder/decoder written in JavaScript.",

@@ -28,13 +28,16 @@ "homepage": "https://mths.be/utf8js",

"scripts": {
"test": "node tests/tests.js"
"test": "node tests/tests.js",
"test-extended": "node tests/tests.js --extended",
"test-browser": "open tests/index.html",
"ci": "npm run build && npm test",
"build": "cd tests; if [ ! -f data.json ]; then python generate-test-data.py; fi",
"cover-html": "istanbul cover --report html --verbose --dir coverage tests/tests.js; istanbul report --root coverage --format html",
"cover-coveralls": "istanbul cover --verbose --dir coverage tests/tests.js && coveralls < coverage/lcov.info; rm -rf coverage/lcov*"
},
"devDependencies": {
"coveralls": "^2.11.14",
"grunt": "^1.0.1",
"grunt-shell": "^1.1.2",
"istanbul": "^0.4.5",
"qunit-extras": "^1.4.2",
"qunitjs": "~1.11.0",
"requirejs": "^2.3.2"
"qunitjs": "~1.11.0"
}
}

38

README.md

@@ -15,14 +15,2 @@ # utf8.js [![Build status](https://travis-ci.org/mathiasbynens/utf8.js.svg?branch=master)](https://travis-ci.org/mathiasbynens/utf8.js) [![Code coverage status](http://img.shields.io/coveralls/mathiasbynens/utf8.js/master.svg)](https://coveralls.io/r/mathiasbynens/utf8.js) [![Dependency status](https://gemnasium.com/mathiasbynens/utf8.js.svg)](https://gemnasium.com/mathiasbynens/utf8.js)

Via [Bower](http://bower.io/):
```bash
bower install utf8
```
Via [Component](https://github.com/component/component):
```bash
component install mathiasbynens/utf8.js
```
In a browser:

@@ -34,30 +22,8 @@

In [Narwhal](http://narwhaljs.org/), [Node.js](https://nodejs.org/), and [RingoJS ≥ v0.8.0](http://ringojs.org/):
In [Node.js](https://nodejs.org/):
```js
var utf8 = require('utf8');
const utf8 = require('utf8');
```
In [Rhino](http://www.mozilla.org/rhino/):
```js
load('utf8.js');
```
Using an AMD loader like [RequireJS](http://requirejs.org/):
```js
require(
{
'paths': {
'utf8': 'path/to/utf8'
}
},
['utf8'],
function(utf8) {
console.log(utf8);
}
);
```
## API

@@ -64,0 +30,0 @@

@@ -1,20 +0,4 @@

/*! https://mths.be/utf8js v2.1.2 by @mathias */
/*! https://mths.be/utf8js v3.0.0 by @mathias */
;(function(root) {
// Detect free variables `exports`
var freeExports = typeof exports == 'object' && exports;
// Detect free variable `module`
var freeModule = typeof module == 'object' && module &&
module.exports == freeExports && module;
// Detect free variable `global`, from Node.js or Browserified code,
// and use it as `root`
var freeGlobal = typeof global == 'object' && global;
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
root = freeGlobal;
}
/*--------------------------------------------------------------------------*/
var stringFromCharCode = String.fromCharCode;

@@ -214,32 +198,6 @@

var utf8 = {
'version': '2.1.2',
'encode': utf8encode,
'decode': utf8decode
};
root.version = '3.0.0';
root.encode = utf8encode;
root.decode = utf8decode;
// Some AMD build optimizers, like r.js, check for specific condition patterns
// like the following:
if (
typeof define == 'function' &&
typeof define.amd == 'object' &&
define.amd
) {
define(function() {
return utf8;
});
} else if (freeExports && !freeExports.nodeType) {
if (freeModule) { // in Node.js or RingoJS v0.8.0+
freeModule.exports = utf8;
} else { // in Narwhal or RingoJS v0.7.0-
var object = {};
var hasOwnProperty = object.hasOwnProperty;
for (var key in utf8) {
hasOwnProperty.call(utf8, key) && (freeExports[key] = utf8[key]);
}
}
} else { // in Rhino or a web browser
root.utf8 = utf8;
}
}(this));
}(typeof exports === 'undefined' ? this.utf8 = {} : exports));
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc