{"_id":"requirejs-plugins","_rev":"7-b2856a8ed57379f17b2b50f72cfe19e6","name":"requirejs-plugins","description":"Small set of plugins for [RequireJS](http://requirejs.org). Some plugins may also work on other AMD loaders (never tested it).","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.2":{"name":"requirejs-plugins","version":"1.0.2","description":"Small set of plugins for [RequireJS](http://requirejs.org). Some plugins may also work on other AMD loaders (never tested it).","main":"src/json.js","directories":{"example":"examples"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/jstrimpel/requirejs-plugins.git"},"author":{"name":"Jason Strimpel","email":"jstrimpel@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/jstrimpel/requirejs-plugins/issues"},"homepage":"https://github.com/jstrimpel/requirejs-plugins","gitHead":"5bff4798522f18b8d8b1631ed67960537bf684cb","_id":"requirejs-plugins@1.0.2","_shasum":"693b5589d97f8598462fc71826353262aafda836","_from":".","_npmVersion":"2.2.0","_nodeVersion":"0.10.31","_npmUser":{"name":"cbarnes","email":"barnescrys@gmail.com"},"maintainers":[{"name":"cbarnes","email":"barnescrys@gmail.com"}],"dist":{"shasum":"693b5589d97f8598462fc71826353262aafda836","tarball":"https://registry.npmjs.org/requirejs-plugins/-/requirejs-plugins-1.0.2.tgz","integrity":"sha512-bX1vGnjDd1iIod3hst47oM/Nv9JiYw4qodWNKgyeQw5ahzSvPI3j1K6hMcK0HtiGRKxebCf+QUrtWzbrZtzQog==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGjV3tU6C2hC2SMUC4liJJWlUxBDTxco5wp2gRv0FwCNAiAWoU6eS/PczDqBmTZg9HBKOGXmdy2pur528DueGHbzTA=="}]}}},"readme":"# RequireJS plugins\n\nSmall set of plugins for [RequireJS](http://requirejs.org). Some plugins may\nalso work on other AMD loaders (never tested it).\n\nFor more plugins check [RequireJS Wiki](https://github.com/jrburke/requirejs/wiki/Plugins).\n\n\n## Install\n\nYou can use [bower](http://bower.io/) to install it easily:\n\n```\nbower install --save requirejs-plugins\n```\n\n\n\n## Plugins\n\n - **async** : Useful for JSONP and asynchronous dependencies (e.g. Google Maps).\n - **font** : Load web fonts using the [WebFont Loader API](https://code.google.com/apis/webfonts/docs/webfont_loader.html)\n   (requires `propertyParser`)\n - **goog** : Load [Google APIs](http://code.google.com/apis/loader/)\n   asynchronously (requires `async!` plugin and `propertyParser`).\n - **image** : Load image files as dependencies. Option to \"cache bust\".\n - **json** : Load JSON files and parses the result. (Requires `text!` plugin).\n - **mdown** : Load Markdown files and parses into HTML. (Requires `text!`\n   plugin and a markdown converter).\n - **noext** : Load scripts without appending \".js\" extension, useful for\n   dynamic scripts.\n\n### Other\n\n - **propertyParser** : Just a helper used by some plugins to parse\n   arguments (not a real plugin).\n\n\n\n## Documentation\n\ncheck the `examples` folder. All the info you probably need will be inside\ncomments or on the example code itself.\n\n\n\n## Basic usage\n\nPut the plugins inside the `baseUrl` folder (usually same folder as the main.js\nfile) or create an alias to the plugin location:\n\n```js\nrequire.config({\n    paths : {\n        //create alias to plugins (not needed if plugins are on the baseUrl)\n        async: 'lib/require/async',\n        font: 'lib/require/font',\n        goog: 'lib/require/goog',\n        image: 'lib/require/image',\n        json: 'lib/require/json',\n        noext: 'lib/require/noext',\n        mdown: 'lib/require/mdown',\n        propertyParser : 'lib/require/propertyParser',\n        markdownConverter : 'lib/Markdown.Converter'\n    }\n});\n\n//use plugins as if they were at baseUrl\ndefine([\n        'image!awsum.jpg',\n        'json!data/foo.json',\n        'noext!js/bar.php',\n        'mdown!data/lorem_ipsum.md',\n        'async!http://maps.google.com/maps/api/js?sensor=false',\n        'goog!visualization,1,packages:[corechart,geochart]',\n        'goog!search,1',\n        'font!google,families:[Tangerine,Cantarell]'\n    ], function(awsum, foo, bar, loremIpsum){\n        //all dependencies are loaded (including gmaps and other google apis)\n    }\n);\n```\n\n\n## Removing plugin code after build\n\n[r.js](https://github.com/jrburke/r.js/blob/master/build/example.build.js)\nnowadays have the `stubModules` setting which can be used to remove the whole\nplugin code:\n\n```js\n({\n    // will remove whole source code of \"json\" and \"text\" plugins during build\n    // JSON/text files that are bundled during build will still work fine but\n    // you won't be able to load JSON/text files dynamically after build\n    stubModules : ['json', 'text']\n})\n```\n\n\n## Notes about the Markdown plugin\n\nThe Markdown plugin was created mainly to be used to compile the markdown files\ninto HTML during the build step, if you set `pragmasOnSave.excludeMdown=true`\nit will remove the `Markdown.Converter.js` and `mdown.js` files from the build.\nExample build settings:\n\n```js\n({\n    baseUrl : './',\n    pragmasOnSave : {\n        excludeMdown : true\n    },\n    paths : {\n        mdown : 'lib/requirejs/mdown',\n        text : 'lib/requirejs/text',\n        markdownConverter : 'lib/Markdown.Converter'\n    },\n    modules : {\n        name : 'main'\n    }\n})\n```\n\nIf `excludeMdown=true` you won't be able to load markdown files dynamically\nafter the build.\n\n\n\n## Writing your own plugins\n\nCheck [RequireJS documentation](http://requirejs.org/docs/plugins.html) for\na basic reference and use other plugins as reference. RequireJS official\nplugins are a good source for learning.\n\nAlso be sure to check [RequireJS Wiki](https://github.com/jrburke/requirejs/wiki/Plugins).\n\n\n\n## Author\n\n[Miller Medeiros](http://blog.millermedeiros.com/)\n\n\n\n## License\n\nAll the plugins are released under the MIT license.\n","maintainers":[{"name":"cbarnes","email":"barnescrys@gmail.com"}],"time":{"modified":"2022-06-26T11:43:17.771Z","created":"2015-02-24T18:53:15.082Z","1.0.2":"2015-02-24T18:53:15.082Z"},"homepage":"https://github.com/jstrimpel/requirejs-plugins","repository":{"type":"git","url":"git://github.com/jstrimpel/requirejs-plugins.git"},"author":{"name":"Jason Strimpel","email":"jstrimpel@gmail.com"},"bugs":{"url":"https://github.com/jstrimpel/requirejs-plugins/issues"},"license":"ISC","readmeFilename":"README.mdown","users":{"rodfernandez":true}}