publish to npm for browsers as per #7

This commit is contained in:
AJ ONeal 2015-11-17 13:35:32 -08:00
parent c67e0582f3
commit bde896c451
3 changed files with 65 additions and 3 deletions

View File

@ -1,7 +1,7 @@
{
"name": "unibabel",
"main": "index.js",
"version": "2.1.2",
"version": "2.1.3",
"homepage": "https://github.com/coolaj86/unibabel-js",
"authors": [
"AJ ONeal <awesome@coolaj86.com>"
@ -12,15 +12,21 @@
"node"
],
"keywords": [
"ascii",
"binary",
"utf8",
"utf-8",
"ArrayBuffer",
"TypedArrays",
"TypedArray",
"Uint",
"Uint8Array",
"Base64",
"b64"
"b64",
"Base32",
"b32"
],
"license": "Apache2",
"license": "Apache-2.0",
"ignore": [
"**/.*",
"node_modules",

19
node.js Normal file
View File

@ -0,0 +1,19 @@
'use strict';
console.warn("Please don't use Unibabel in node.js. If you think you really think you have a valid use case please report it at https://github.com/coolaj86/unibabel-js/issues/new");
throw new Error("[unibabel] you're doing it wrong");
/*
var data = 'I ½ ♥ 💩';
var encoding = 'utf8';
var buf = new Buffer(data, encoding);
buf.toString('hex');
buf.toString('base64');
buf.toString('ascii');
buf.toString('utf8');
buf.toString('binary'); // deprecated, do not use
var Base32 = require('thirty-two');
var b32 = Base32.encode(buf);
Base32.decode(buf);
*/

37
package.json Normal file
View File

@ -0,0 +1,37 @@
{
"name": "unibabel",
"version": "2.1.3",
"description": "Base64, TypedArrays, and UTF-8 / Unicode conversions in Browser (and Node) JavaScript",
"main": "node.js",
"browser": {
"./node.js": "./index.js"
}
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/coolaj86/unibabel-js.git"
},
"keywords": [
"ascii",
"binary",
"utf8",
"utf-8",
"ArrayBuffer",
"TypedArrays",
"TypedArray",
"Uint",
"Uint8Array",
"Base64",
"b64",
"Base32",
"b32"
],
"author": "AJ ONeal <coolaj86@gmail.com> (http://coolaj86.com/)",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/coolaj86/unibabel-js/issues"
},
"homepage": "https://github.com/coolaj86/unibabel-js#readme"
}