Permalink
Browse files

updated examples with non-node compatible defines

  • Loading branch information...
1 parent 447852b commit 70dc346244b06104fd6d6c4ec7803453a5fc2fee @CrabDude committed Jul 26, 2011
Showing with 15 additions and 7 deletions.
  1. +8 −4 README.md
  2. +3 −1 examples/bar.js
  3. +3 −1 examples/baz.js
  4. +1 −1 package.json
View
@@ -5,12 +5,14 @@ See [/examples](https://github.com/CrabDude/node-amd/tree/master/examples).
### Install
- npm install node-apm
+ npm install AMD
### Example1
// bar.js
- var define = require('node-amd').define;
+ if (typeof module !== 'undefined' && "exports" in module && typeof define !== 'function') {
+ var define = require('AMD').define;
+ }
define(['http','path','fs'],function(http,path,fs) {
return {
@@ -21,8 +23,10 @@ See [/examples](https://github.com/CrabDude/node-amd/tree/master/examples).
### Example2
// baz.js
- var define = require('node-amd').define;
-
+ if (typeof module !== 'undefined' && "exports" in module && typeof define !== 'function') {
+ var define = require('AMD').define;
+ }
+
define({
wtf: 'yeehaw'
});
View
@@ -1,4 +1,6 @@
-var define = require('../lib/amd').define;
+if (typeof module !== 'undefined' && "exports" in module && typeof define !== 'function') {
+ var define = require('../lib/amd').define;
+}
define(['http','path','fs'],function(http,path,fs) {
return {
View
@@ -1,4 +1,6 @@
-var define = require('../lib/amd').define;
+if (typeof module !== 'undefined' && "exports" in module && typeof define !== 'function') {
+ var define = require('../lib/amd').define;
+}
define({
wtf: 'yeehaw'
View
@@ -1,6 +1,6 @@
{
"name" : "AMD",
- "version" : "0.0.2",
+ "version" : "0.0.3",
"description" : "AMD (Asynchronous Module Definition) support for node.js, specifically define()",
"homepage": "http://github.com/CrabDude/amd",
"repository": {

0 comments on commit 70dc346

Please sign in to comment.