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

fastestsmallesttextencoderdecoder

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastestsmallesttextencoderdecoder - npm Package Compare versions

Comparing version 1.0.14 to 1.0.15

4

EncoderDecoderTogether.min.js
'use strict';(function(f){function r(b){var a=b.charCodeAt(0)<<24,c=t(~a)|0,d=0,m=b.length|0,g="";if(5>c&&m>=c){a=a<<c>>>24+c;for(d=1;d<c;d=d+1|0)a=a<<6|b.charCodeAt(d)&63;65535>=a?g+=e(a):1114111>=a?(a=a-65536|0,g+=e((a>>10)+55296|0,(a&1023)+56320|0)):d=0}for(;d<m;d=d+1|0)g+="\ufffd";return g}function n(){}function u(b){var a=b.charCodeAt(0)|0;if(55296<=a&&56319>=a){var c=b.charCodeAt(1)|0;if(c===c&&56320<=c&&57343>=c){if(a=(a-55296<<10)+c-56320+65536|0,65535<a)return e(240|a>>>18,128|a>>>12&63,
128|a>>>6&63,128|a&63)}else return e(239,191,189)}return 127>=a?b:2047>=a?e(192|a>>>6,128|a&63):e(224|a>>>12,128|a>>>6&63,128|a&63)}function p(){}var v=Math.log,w=Math.LN2,t=Math.clz32||function(b){return 31-v(b>>>0)/w|0},e=String.fromCharCode,k={}.toString,q=f.SharedArrayBuffer,x=q?k.call(q):"",h=f.Uint8Array,l=h||Array,y=k.call((h?ArrayBuffer:l).prototype);n.prototype.decode=function(b){b=b&&b.buffer||b;var a=k.call(b);if(a!==y&&a!==x)throw Error("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");
b=h?new l(b):b;a="";for(var c=0,d=b.length|0;c<d;c=c+32768|0)a+=e.apply(0,b[h?"subarray":"slice"](c,c+32768|0));return a.replace(/[\xc0-\xff][\x80-\xbf]*/g,r)};f.TextDecoder||(f.TextDecoder=n);p.prototype.encode=function(b){b=void 0===b?"":(""+b).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,u);for(var a=b.length|0,c=new l(a),d=0;d<a;d=d+1|0)c[d]=b.charCodeAt(d);return c};f.TextEncoder||(f.TextEncoder=p)})("undefined"==typeof global?"undefined"==typeof self?this:self:global);//AnonyCo
128|a>>>6&63,128|a&63)}else return e(239,191,189)}return 127>=a?b:2047>=a?e(192|a>>>6,128|a&63):e(224|a>>>12,128|a>>>6&63,128|a&63)}function p(){}var v=Math.log,w=Math.LN2,t=Math.clz32||function(b){return 31-v(b>>>0)/w|0},e=String.fromCharCode,k={}.toString,q=f.SharedArrayBuffer,x=q?k.call(q):"",h=f.Uint8Array,l=h||Array,y=k.call((h?ArrayBuffer:l).prototype);n.prototype.decode=function(b){var a=b&&b.buffer||b,c=k.call(a);if(c!==y&&c!==x||void 0===b)throw Error("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");
b=h?new l(a):a;a="";c=0;for(var d=b.length|0;c<d;c=c+32768|0)a+=e.apply(0,b[h?"subarray":"slice"](c,c+32768|0));return a.replace(/[\xc0-\xff][\x80-\xbf]*/g,r)};f.TextDecoder||(f.TextDecoder=n);p.prototype.encode=function(b){b=void 0===b?"":(""+b).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,u);for(var a=b.length|0,c=new l(a),d=0;d<a;d=d+1|0)c[d]=b.charCodeAt(d);return c};f.TextEncoder||(f.TextEncoder=p)})(""+void 0==typeof global?""+void 0==typeof self?this:self:global);//AnonyCo
//# sourceMappingURL=EncoderDecoderTogether.min.js.map

@@ -1,5 +0,6 @@

'use strict';(function(f){var y=Math.log,z=Math.LN2,A=Math.clz32||function(b){return 31-y(b>>>0)/z|0},g=String.fromCharCode,k={}.toString,n=f.SharedArrayBuffer,B=n?k.call(n):"",h=f.Uint8Array,C=h?k.call(ArrayBuffer.prototype):"",e=f.Buffer;try{!e&&f.require&&(e=f.require("Buffer"));var p=e.prototype,D=e?k.call(p):""}catch(b){}var q=!!h&&!e,r=!e||!!h&&h.prototype.isPrototypeOf(p);if(q||e){var m=function(b){b.TextDecoder||(b.TextDecoder=t);b.TextEncoder||(b.TextEncoder=u);b!==f&&(b.decode=v,b.encode=
w);return b},w=function(b){b=void 0===b?"":(""+b).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,E);for(var a=b.length|0,c=q?new h(a):e.alloc?e.alloc(a):new e(a),d=0;d<a;d=d+1|0)c[d]=b.charCodeAt(d)|0;return c},u=function(){},E=function(b){var a=b.charCodeAt(0)|0;if(55296<=a&&56319>=a){var c=b.charCodeAt(1)|0;if(c===c&&56320<=c&&57343>=c){if(a=(a-55296<<10)+c-56320+65536|0,65535<a)return g(240|a>>>18,128|a>>>12&63,128|a>>>6&63,128|a&63)}else return g(239,191,189)}return 127>=
a?b:2047>=a?g(192|a>>>6,128|a&63):g(224|a>>>12,128|a>>>6&63,128|a&63)},v=function(b){b=b&&b.buffer||b;var a=k.call(b);if(a!==C&&a!==D&&a!==B&&"[object ArrayBuffer]"!==a)throw Error("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");b=r?new h(b):b;a="";for(var c=0,d=b.length|0;c<d;c=c+32768|0)a+=g.apply(0,b[r?"subarray":"slice"](c,c+32768|0));return a.replace(/[\xc0-\xff][\x80-\xbf]*/g,F)},t=function(){},F=function(b){var a=b.charCodeAt(0)<<
24,c=A(~a)|0,d=0,x=b.length|0,l="";if(5>c&&x>=c){a=a<<c>>>24+c;for(d=1;d<c;d=d+1|0)a=a<<6|b.charCodeAt(d)&63;65535>=a?l+=g(a):1114111>=a?(a=a-65536|0,l+=g((a>>10)+55296|0,(a&1023)+56320|0)):d=0}for(;d<x;d=d+1|0)l+="\ufffd";return l};t.prototype.decode=v;u.prototype.encode=w;typeof define==typeof m&&define.amd?define(function(){return m({})}):m("object"==typeof exports?exports:f)}})("undefined"==typeof global?"undefined"==typeof self?this:self:global);//AnonyCo
'use strict';(function(f){var B=Math.log,C=Math.LN2,D=Math.clz32||function(b){return 31-B(b>>>0)/C|0},g=String.fromCharCode,k={}.toString,q=f.SharedArrayBuffer,E=q?k.call(q):"",h=f.Uint8Array,F=h?k.call(ArrayBuffer.prototype):"",e=f.Buffer;try{!e&&f.require&&(e=f.require("Buffer"));var r=e.prototype,G=e?k.call(r):""}catch(b){}var t=!!h&&!e,u=!e||!!h&&h.prototype.isPrototypeOf(r);if(t||e){var l=function(b){b.TextEncoder=n||v;b.TextDecoder=p||w;b!==f&&(b.encode=n?x(new n,"encode"):y,b.decode=p?x(new p,
"decode"):z);return b},x=function(b,a,c){c=b[a];return function(){c.apply(b,arguments)}},y=function(b){b=void 0===b?"":(""+b).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,H);for(var a=b.length|0,c=t?new h(a):e.allocUnsafe?e.allocUnsafe(a):new e(a),d=0;d<a;d=d+1|0)c[d]=b.charCodeAt(d)|0;return c},v=function(){},H=function(b){var a=b.charCodeAt(0)|0;if(55296<=a&&56319>=a){var c=b.charCodeAt(1)|0;if(c===c&&56320<=c&&57343>=c){if(a=(a-55296<<10)+c-56320+65536|0,65535<a)return g(240|
a>>>18,128|a>>>12&63,128|a>>>6&63,128|a&63)}else return g(239,191,189)}return 127>=a?b:2047>=a?g(192|a>>>6,128|a&63):g(224|a>>>12,128|a>>>6&63,128|a&63)},z=function(b){var a=b&&b.buffer||b,c=k.call(a);if(c!==F&&c!==G&&c!==E&&"[object ArrayBuffer]"!==c||void 0===b)throw Error("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");b=u?new h(a):a;a="";c=0;for(var d=b.length|0;c<d;c=c+32768|0)a+=g.apply(0,b[u?"subarray":"slice"](c,c+32768|
0));return a.replace(/[\xc0-\xff][\x80-\xbf]*/g,I)},w=function(){},I=function(b){var a=b.charCodeAt(0)<<24,c=D(~a)|0,d=0,A=b.length|0,m="";if(5>c&&A>=c){a=a<<c>>>24+c;for(d=1;d<c;d=d+1|0)a=a<<6|b.charCodeAt(d)&63;65535>=a?m+=g(a):1114111>=a?(a=a-65536|0,m+=g((a>>10)+55296|0,(a&1023)+56320|0)):d=0}for(;d<A;d=d+1|0)m+="\ufffd";return m};w.prototype.decode=z;v.prototype.encode=y;var n=f.TextEncoder,p=f.TextDecoder;"object"===typeof exports&&"undefined"!==typeof module?l(module.exports):typeof define==
typeof l&&define.amd?define(function(){return l({})}):l(f)}})("undefined"==typeof global?"undefined"==typeof self?this||{}:self:global);//AnonyCo
//# sourceMappingURL=EncoderAndDecoderNodeJS.min.js.map

@@ -1,6 +0,7 @@

'use strict';var e="undefined"==typeof global?self:global,f=Math.log,g=Math.LN2,h=Math.clz32||function(b){return 31-f(b>>>0)/g|0},k=String.fromCharCode,m={}.toString,n=e.SharedArrayBuffer,p=n?m.call(n):"",q=e.Uint8Array,r=q?m.call(ArrayBuffer.prototype):"",t=e.Buffer;try{!t&&e.require&&(t=e.require("Buffer"));var u=t.prototype,w=m.call(u)}catch(b){}var x=!!q&&!t,y=!t||!!q&&q.prototype.isPrototypeOf(u);
function z(b){var a=b.charCodeAt(0)<<24,c=h(~a)|0,d=0,v=b.length|0,l="";if(5>c&&v>=c){a=a<<c>>>24+c;for(d=1;d<c;d=d+1|0)a=a<<6|b.charCodeAt(d)&63;65535>=a?l+=k(a):1114111>=a?(a=a-65536|0,l+=k((a>>10)+55296|0,(a&1023)+56320|0)):d=0}for(;d<v;d=d+1|0)l+="\ufffd";return l}function A(){}
function B(b){b=b&&b.buffer||b;var a=m.call(b);if(a!==r&&a!==w&&a!==p&&"[object ArrayBuffer]"!==a)throw Error("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");b=y?new q(b):b;a="";for(var c=0,d=b.length|0;c<d;c=c+32768|0)a+=k.apply(0,b[y?"subarray":"slice"](c,c+32768|0));return a.replace(/[\xc0-\xff][\x80-\xbf]*/g,z)}A.prototype.decode=B;
'use strict';var e="undefined"==typeof global?"undefined"===typeof self?{}:self:global,f=Math.log,g=Math.LN2,h=Math.clz32||function(b){return 31-f(b>>>0)/g|0},k=String.fromCharCode,m={}.toString,n=e.SharedArrayBuffer,p=n?m.call(n):"",q=e.Uint8Array,r=q?m.call(ArrayBuffer.prototype):"",u=e.Buffer;try{!u&&e.require&&(u=e.require("Buffer"));var v=u.prototype,w=m.call(v)}catch(b){}var x=!!q&&!u,y=!u||!!q&&q.prototype.isPrototypeOf(v);
function z(b){var a=b.charCodeAt(0)<<24,c=h(~a)|0,d=0,t=b.length|0,l="";if(5>c&&t>=c){a=a<<c>>>24+c;for(d=1;d<c;d=d+1|0)a=a<<6|b.charCodeAt(d)&63;65535>=a?l+=k(a):1114111>=a?(a=a-65536|0,l+=k((a>>10)+55296|0,(a&1023)+56320|0)):d=0}for(;d<t;d=d+1|0)l+="\ufffd";return l}function A(){}
function B(b){var a=b&&b.buffer||b,c=m.call(a);if(c!==r&&c!==w&&c!==p&&"[object ArrayBuffer]"!==c||void 0===b)throw Error("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");b=y?new q(a):a;a="";c=0;for(var d=b.length|0;c<d;c=c+32768|0)a+=k.apply(0,b[y?"subarray":"slice"](c,c+32768|0));return a.replace(/[\xc0-\xff][\x80-\xbf]*/g,z)}A.prototype.decode=B;
function C(b){var a=b.charCodeAt(0)|0;if(55296<=a&&56319>=a){var c=b.charCodeAt(1)|0;if(c===c&&56320<=c&&57343>=c){if(a=(a-55296<<10)+c-56320+65536|0,65535<a)return k(240|a>>>18,128|a>>>12&63,128|a>>>6&63,128|a&63)}else return k(239,191,189)}return 127>=a?b:2047>=a?k(192|a>>>6,128|a&63):k(224|a>>>12,128|a>>>6&63,128|a&63)}function D(){}
function E(b){b=void 0===b?"":(""+b).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,C);for(var a=b.length|0,c=x?new q(a):t.alloc?t.alloc(a):new t(a),d=0;d<a;d=d+1|0)c[d]=b.charCodeAt(d)|0;return c}D.prototype.encode=E;var F=e.TextDecoder||A,G=e.TextEncoder||D;export var TextDecoder=F;export var TextEncoder=G;export var decode=F===A?B:new F.decode;export var encode=G===D?E:new G.encode;//AnonyCo
function E(b){b=void 0===b?"":(""+b).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,C);for(var a=b.length|0,c=x?new q(a):u.allocUnsafe?u.allocUnsafe(a):new u(a),d=0;d<a;d=d+1|0)c[d]=b.charCodeAt(d)|0;return c}D.prototype.encode=E;var F=e.TextDecoder,G=e.TextEncoder;function H(b,a){var c=b[a];return function(){c.apply(b,arguments)}}export var TextEncoder=G||D;export var TextDecoder=F||A;export var encode=G?H(new G,"encode"):E;
export var decode=F?H(new F,"decode"):B;//AnonyCo
//# sourceMappingURL=EncoderAndDecoderNodeJS.min.module.js.map
{
"name": "fastestsmallesttextencoderdecoder",
"version": "1.0.14",
"version": "1.0.15",
"description": "The fastest smallest Javascript polyfill for the encode of TextEncoder and decode of TextDecoder for UTF-8 only. Made by AnonyCo with ❤️ from 🐕s.",

@@ -33,8 +33,9 @@ "keywords": [

"scripts": {
"install-dev": "npm install; mkdir compiler-latest 2> /dev/null; wget -P ./compiler-latest/ 'https://dl.google.com/closure-compiler/compiler-latest.tar.gz'; unlink ./closure-compiler.jar 2> /dev/null; cd compiler-latest; tar xvzf compiler-latest.tar.gz; bash -c 'for j in closure-compiler-*; do mv -- \"$j\" \"../closure-compiler.jar\" 1> /dev/null; done' 1> /dev/null 2> /dev/null; cd ..; rm -rf compiler-latest 2> /dev/null",
"build": "npm run build-browser; npm run build-require; npm run build-module",
"build-browser": "java -Xms32M -Xmx1024M -jar ./closure-compiler.jar --source_map_format V3 --js './EncoderDecoderTogether.src.js' --js_output_file './EncoderDecoderTogether.min.js' --create_source_map './EncoderDecoderTogether.min.js.map' --language_out ECMASCRIPT_2017 --compilation_level ADVANCED_OPTIMIZATIONS --output_wrapper '%output%//AnonyCo\n//# sourceMappingURL=EncoderDecoderTogether.min.js.map'; java -Xms32M -Xmx1024M -jar ./closure-compiler.jar --source_map_format V3 --js './individual/FastestTextDecoderPolyfill.src.js' --js_output_file './individual/FastestTextDecoderPolyfill.min.js' --create_source_map './individual/FastestTextDecoderPolyfill.min.js.map' --language_out ECMASCRIPT_2017 --compilation_level ADVANCED_OPTIMIZATIONS --output_wrapper '%output%//AnonyCo\n//# sourceMappingURL=FastestTextDecoderPolyfill.min.js.map'; java -Xms32M -Xmx1024M -jar ./closure-compiler.jar --source_map_format V3 --js './individual/FastestTextEncoderPolyfill.src.js' --js_output_file './individual/FastestTextEncoderPolyfill.min.js' --create_source_map './individual/FastestTextEncoderPolyfill.min.js.map' --language_out ECMASCRIPT_2017 --compilation_level ADVANCED_OPTIMIZATIONS --output_wrapper '%output%//AnonyCo\n//# sourceMappingURL=FastestTextEncoderPolyfill.min.js.map'",
"install-dev": "npm install; mkdir compiler-latest 2> /dev/null; wget -P ./compiler-latest/ 'https://dl.google.com/closure-compiler/compiler-latest.tar.gz'; unlink ./closure-compiler.jar 2> /dev/null; wget -P ./compiler-latest/ 'https://github.com/google/zopfli/archive/zopfli-1.0.3.tar.gz'; cd compiler-latest; tar xvzf compiler-latest.tar.gz 1> /dev/null; tar xvzf compiler-latest.tar.gz 1> /dev/null; bash -c 'for j in closure-compiler-*; do mv -- \"$j\" \"../closure-compiler.jar\" 1> /dev/null; done' 1> /dev/null 2> /dev/null; cd zopfli-zopfli-1.0.3; make zopfli 1> /dev/null; mv ./zopfli ../../; cd ..; rm -rf compiler-latest 2> /dev/null; chmod +x zopfli",
"build": "npm run build-browser; (npm run build-gzip & ); npm run build-require; npm run build-module",
"build-browser": "java -Xms32M -Xmx1024M -jar ./closure-compiler.jar --source_map_format V3 --js './EncoderDecoderTogether.src.js' --js_output_file './EncoderDecoderTogether.min.js' --create_source_map './EncoderDecoderTogether.min.js.map' --language_out ECMASCRIPT_2017 --compilation_level ADVANCED_OPTIMIZATIONS --output_wrapper '%output%//AnonyCo\n//# sourceMappingURL=EncoderDecoderTogether.min.js.map'; java -Xms32M -Xmx1024M -jar ./closure-compiler.jar --source_map_format V3 --js './individual/FastestTextDecoderPolyfill.src.js' --js_output_file './individual/FastestTextDecoderPolyfill.min.js' --create_source_map './individual/FastestTextDecoderPolyfill.min.js.map' --language_out ECMASCRIPT_2017 --compilation_level ADVANCED_OPTIMIZATIONS --output_wrapper '%output%//AnonyCo\n//# sourceMappingURL=FastestTextDecoderPolyfill.min.js.map'; java -Xms32M -Xmx1024M -jar ./closure-compiler.jar --source_map_format V3 --js './individual/FastestTextEncoderPolyfill.src.js' --js_output_file './individual/FastestTextEncoderPolyfill.min.js' --create_source_map './individual/FastestTextEncoderPolyfill.min.js.map' --language_out ECMASCRIPT_2017 --compilation_level ADVANCED_OPTIMIZATIONS --output_wrapper '%output%//AnonyCo\n//# sourceMappingURL=FastestTextEncoderPolyfill.min.js.map'; sed -i -e 's/\"undefined\"/\"\"+void 0/g' './EncoderDecoderTogether.min.js'",
"build-require": "java -Xms32M -Xmx1024M -jar ./closure-compiler.jar --source_map_format V3 --js './NodeJS/EncoderAndDecoderNodeJS.src.js' --js_output_file ./NodeJS/EncoderAndDecoderNodeJS.min.js --create_source_map ./NodeJS/EncoderAndDecoderNodeJS.min.js.map --compilation_level ADVANCED_OPTIMIZATIONS --output_wrapper '%output%//AnonyCo\n//# sourceMappingURL=EncoderAndDecoderNodeJS.min.js.map' --language_out ECMASCRIPT_2017",
"build-module": "java -Xms32M -Xmx1024M -jar ./closure-compiler.jar --source_map_format V3 --js './NodeJS/EncoderAndDecoderNodeJS.src.module.js' --js_output_file ./NodeJS/EncoderAndDecoderNodeJS.min.module.js --create_source_map ./NodeJS/EncoderAndDecoderNodeJS.min.module.js.map --compilation_level ADVANCED_OPTIMIZATIONS --output_wrapper '%output%//AnonyCo\n//# sourceMappingURL=EncoderAndDecoderNodeJS.min.module.js.map' --language_out ECMASCRIPT_2017; sed -i -e 's/window\\.export_/export var /g' './NodeJS/EncoderAndDecoderNodeJS.min.module.js'",
"build-es6": "java -Xms32M -Xmx1024M -jar ./closure_compiler.jar --source_map_format V3 --js './NodeJS/EncoderAndDecoderNodeJS.src.module.js' --js_output_file ./NodeJS/EncoderAndDecoderNodeJS.min.module.js --create_source_map ./NodeJS/EncoderAndDecoderNodeJS.min.module.js.map --compilation_level ADVANCED_OPTIMIZATIONS --output_wrapper '%output%//AnonyCo\n//# sourceMappingURL=EncoderAndDecoderNodeJS.min.module.js.map' --language_out ECMASCRIPT_2017; sed -i -e 's/window\\.export_/export var /g' './NodeJS/EncoderAndDecoderNodeJS.min.module.js'"
"build-es6": "java -Xms32M -Xmx1024M -jar ./closure-compiler.jar --source_map_format V3 --js './NodeJS/EncoderAndDecoderNodeJS.src.module.js' --js_output_file ./NodeJS/EncoderAndDecoderNodeJS.min.module.js --create_source_map ./NodeJS/EncoderAndDecoderNodeJS.min.module.js.map --compilation_level ADVANCED_OPTIMIZATIONS --output_wrapper '%output%//AnonyCo\n//# sourceMappingURL=EncoderAndDecoderNodeJS.min.module.js.map' --language_out ECMASCRIPT_2017; sed -i -e 's/window\\.export_/export var /g' './NodeJS/EncoderAndDecoderNodeJS.min.module.js'",
"build-gzip": "./zopfli -i20 ./EncoderDecoderTogether.min.js; mv ./EncoderDecoderTogether.min.js.gz ./gh-pages/"
},

@@ -41,0 +42,0 @@ "license": "Unlicense",

@@ -7,4 +7,3 @@

[![GitHub file size in bytes](https://img.shields.io/github/size/anonyco/FastestSmallestTextEncoderDecoder/gh-pages/EncoderDecoderTogether.min.js.gz.svg?label=gzip%20applied)](https://github.com/anonyco/FastestSmallestTextEncoderDecoder/blob/master/gh-pages/EncoderDecoderTogether.min.js.gz "Gzipped file")
[![npm bundle size (version)](https://img.shields.io/bundlephobia/min/fastestsmallesttextencoderdecoder/latest.svg?color=maroon&label=NPM%20bundle%20size)](https://npmjs.org/package/fastestsmallesttextencoderdecoder "View this project on npm")
[![Issues](http://img.shields.io/github/issues/anonyco/FastestSmallestTextEncoderDecoder.svg)]( https://github.com/anonyco/FastestSmallestTextEncoderDecoder/issues )
[![npm bundle size (version)](https://img.shields.io/bundlephobia/min/fastestsmallesttextencoderdecoder/latest.svg?color=maroon&label=NPM%20bundle%20size)](https://npmjs.org/package/fastestsmallesttextencoderdecoder "View this project on npm")<!--[![Issues](http://img.shields.io/github/issues/anonyco/FastestSmallestTextEncoderDecoder.svg)]( https://github.com/anonyco/FastestSmallestTextEncoderDecoder/issues )-->
[![Unlicense license](http://img.shields.io/badge/license-Unlicense-brightgreen.svg)](https://unlicense.org/ "This project's liscence")

@@ -17,12 +16,12 @@ [![npm downloads](https://img.shields.io/npm/dt/fastestsmallesttextencoderdecoder.svg)](https://npmjs.org/package/fastestsmallesttextencoderdecoder "View this project on npm")

Add the following HTML Code to your head:
Add the following HTML Code inside the `<head>`:
````HTML
<script src="https://dl.dropboxusercontent.com/s/r55397ld512etib/EncoderDecoderTogether.min.js?dl=0" type="text/javascript"></script>
<script src="https://dl.dropboxusercontent.com/s/r55397ld512etib/EncoderDecoderTogether.min.js?dl=0" nomodule="" type="text/javascript"></script>
````
If you know that no script on the page requires this library until the DOMContentLoaded event, then you can switch to the much less blocking version below:
If no script on the page requires this library until the DOMContentLoaded event, then use the the much less blocking version below:
````HTML
<script defer="" src="https://dl.dropboxusercontent.com/s/r55397ld512etib/EncoderDecoderTogether.min.js?dl=0" type="text/javascript"></script>
<script defer="" src="https://dl.dropboxusercontent.com/s/r55397ld512etib/EncoderDecoderTogether.min.js?dl=0" nomodule="" type="text/javascript"></script>
````

@@ -32,2 +31,4 @@

The `nomodule` attribute prevents the script from being needlessly downloaded and executed on browsers which already support `TextEncoder` and `TextDecoder`. `nomodule` does not test for the presence of `TextEncoder` or `TextDecoder`, but it is very safe to assume that browsers advanced enough to support modules also support `TextEncoder` and `TextDecoder`.
## RequireJS and NodeJS

@@ -41,2 +42,11 @@

## AngularJS
Open a terminal in the project's directory, and install fastestsmallesttextencoderdecoder via npm.
```Bash
npm install fastestsmallesttextencoderdecoder
```
Then, add `import 'fastestsmallesttextencoderdecoder';` to the polyfills.ts file.
## Browser Support

@@ -52,3 +62,3 @@

Also note that while this polyfill may work in these old browsers, it is very likely that the rest of your website will not (unless if you make a concious effort about it which I would not reccomend because noone uses or should use these old browsers).
Also note that while this polyfill may work in these old browsers, it is very likely that the rest of one's website will not unless if one make a concious effort to have their code work in these old browsers.

@@ -65,3 +75,3 @@ \* Partial polyfill means that `Array` (or `Buffer` in NodeJS) will be used instead of `Uint8Array`/\[*typedarray*\].

As for NodeJS, calling `require("EncoderAndDecoderNodeJS.min.js")` yields the following object:
As for NodeJS, calling `require("EncoderAndDecoderNodeJS.min.js")` yields the following object. Note that this polyfill checks for `global.TextEncoder` and `global.TextDecoder` and returns the native implementation if available.

@@ -77,3 +87,3 @@ ```Javascript

Thus, in NodeJS, you do not ever have to use `new` just to get the encoder/decoder (although you still can do so if you want to). All of the code snippets below function identically <sub>(aside from unused local variables introduced into the scope)</sub>. There are an innumerable number of ways to rewrite this same snippet of code, thus I only chose the three which I thought would be most useful.
In NodeJS, one does not ever have to use `new` just to get the encoder/decoder (although one still can do so if they want to). All of the code snippets below function identically <sub>(aside from unused local variables introduced into the scope)</sub>.

@@ -99,3 +109,3 @@ ```Javascript

Or, you can use the new and shiny [ES6 module importation](https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/import) statements.
Or, one can use the new and shiny [ES6 module importation](https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/import) statements.

@@ -122,2 +132,3 @@

Note that *fastestsmallesttextencoderdecoder* must be installed via the following snippet in the terminal in order for the `require("fastestsmallesttextencoderdecoder")` to work.

@@ -134,7 +145,7 @@

## npm Project
You can find this project on [npm here at this link](https://npmjs.org/package/fastestsmallesttextencoderdecoder).
This project can be found on [npm here at this link](https://npmjs.org/package/fastestsmallesttextencoderdecoder).
# Development
On linux, you can develop the project on your own by cloning it with the following command line.
On linux, the project can be developed by cloning it with the following command line.

@@ -147,3 +158,3 @@ ```Bash

Now that the repository is cloned, edit the files as you see fit. Now that the files have been edited, run the following in the terminal in the root folder of the repository in order to minify the NodeJS JavaScript files.
Now that the repository is cloned, edit the files as one see fit. Now that the files have been edited, run the following in the terminal in the root folder of the repository in order to minify the NodeJS JavaScript files.

@@ -150,0 +161,0 @@ ```Bash

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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