Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#29 add package.json #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "jschannel",
"version": "1.0.0",
"description": "A JavaScript library which implements fancy IPC semantics on top of postMessage.",
"main": "src/jschannel.js",
"directories": {
"doc": "docs",
"example": "example"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/mozilla/jschannel.git"
},
"author": "",
"license": "MPL-1.1",
"bugs": {
"url": "https://github.com/mozilla/jschannel/issues"
},
"homepage": "https://github.com/mozilla/jschannel#readme"
}
17 changes: 16 additions & 1 deletion src/jschannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
* the onReady function will be passed a single argument which is
* the channel object that was returned from build().
*/
return {
var _channel = {
build: function(cfg) {
var debug = function(m) {
if (cfg.debugOutput && window.console && window.console.log) {
Expand Down Expand Up @@ -617,4 +617,19 @@
return obj;
}
};

if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = _channel;
}
exports.Channel = _channel;
}

if (typeof define === 'function' && define.amd) {
define('jschannel', [], function() {
return _channel;
});
}

return _channel;
})();