10000 Support nodejs (module.exports) · arduino/cbor-js@16c9087 · GitHub
[go: up one dir, main page]

Skip to content

Commit 16c9087

Browse files
letmaikparoga
authored andcommitted
Support nodejs (module.exports)
1 parent 8527a43 commit 16c9087

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cbor.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,8 @@ var obj = { encode: encode, decode: decode };
398398

399399
if (typeof define === "function" && define.amd)
400400
define("cbor/cbor", obj);
401+
else if (typeof module !== "undefined" && module.exports)
402+
module.exports = obj;
401403
else if (!global.CBOR)
402404
global.CBOR = obj;
403405

0 commit comments

Comments
 (0)
0