{"_id":"nclosure","_rev":"14-dd378b304a8328e85671be06755302cf","name":"nclosure","description":"Server-side Google Closure with Node.js","dist-tags":{"latest":"0.4.3"},"versions":{"0.3.1":{"name":"nclosure","description":"Server-side Google Closure with Node.js","author":{"name":"Guido Tapia","email":"guido@tapia.com.au"},"url":"https://github.com/gatapia/nclosure","directories":{"lib":"./lib","bin":"./bin","example":"./examples"},"dependencies":{"cli":"*"},"main":"./lib/nclosure","version":"0.3.1","engines":{"node":">=0.3.0-pre"},"repository":{"type":"git","url":"git://github.com/gatapia/nclosure.git"},"licenses":[{"type":"Apache License, Version 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"_id":"nclosure@0.3.1","_engineSupported":true,"_npmVersion":"0.2.17","_nodeVersion":"v0.3.8-pre","bin":{"ncstyle":"bin/ncstyle.js","nodetestsrunner":"bin/nodetestsrunner.js","closure.json":"bin/closure.json","nodetestinstance":"bin/nodetestinstance.js","ncdoc":"bin/ncdoc.js","deps":"bin/deps.js","nctest":"bin/nctest.js","nccompile":"bin/nccompile.js"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"cb4b7675b431bf606a174c3b839f3bdb555406c1","tarball":"https://registry.npmjs.org/nclosure/-/nclosure-0.3.1.tgz","integrity":"sha512-VdWgZ4+hvT7FwJv5+oDGbHMsB/H8siN8m4u1eJscc1aRmjRGrKVJPSWeknvR9hbSovP3BfON2q/IF2Wad/lrQQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHftf3zXt7AnFs9TxpL02xOdzGrOKzr4C7echZ5VlxTvAiEA9YXNxP+CQiHWAB38SG1rAdA+Y3ynlCTFCy67plfId+0="}]}},"0.4.0":{"name":"nclosure","description":"Server-side Google Closure with Node.js","author":{"name":"Guido Tapia","email":"guido@tapia.com.au"},"url":"https://github.com/gatapia/nclosure","directories":{"lib":"./third_party","bin":"./bin","example":"./examples"},"dependencies":{"cli":"*"},"main":"./lib/nclosure","version":"0.4.0","engines":{"node":">=0.3.0-pre"},"repository":{"type":"git","url":"git://github.com/gatapia/nclosure.git"},"licenses":[{"type":"Apache License, Version 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"_id":"nclosure@0.4.0","_engineSupported":true,"_npmVersion":"0.2.17","_nodeVersion":"v0.3.8-pre","bin":{"ncstyle":"bin/ncstyle.js","nodetestsrunner":"bin/nodetestsrunner.js","closure.json":"bin/closure.json","nodetestinstance":"bin/nodetestinstance.js","ncdoc":"bin/ncdoc.js","deps":"bin/deps.js","nctest":"bin/nctest.js","nccompile":"bin/nccompile.js"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"eb777dfffed1dc79c2748b68313b846edeeb3bf5","tarball":"https://registry.npmjs.org/nclosure/-/nclosure-0.4.0.tgz","integrity":"sha512-wQoHXyeAv2uLORDNDPSYXaLusHMjYZjI72ox7a1ph965O0g3EFNEaqw/dV3/b8ZzF8XjnfT0+7Mu7YDWpQvOUA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA6uhS6Ff4YDwuRE8Jx4RRmuhKyb8qO7oV4AeaBQ8iHSAiEA86rNcrmnc8Ff30LiruQ5OANjUkCT3LItWmAZTABiXBs="}]}},"0.4.1":{"name":"nclosure","description":"Server-side Google Closure with Node.js","author":{"name":"Guido Tapia","email":"guido@tapia.com.au"},"url":"https://github.com/gatapia/nclosure","directories":{"lib":"./third_party","bin":"./bin","example":"./examples"},"dependencies":{"cli":"*"},"main":"./lib/nclosure","version":"0.4.1","engines":{"node":">=0.3.0-pre"},"repository":{"type":"git","url":"git://github.com/gatapia/nclosure.git"},"licenses":[{"type":"Apache License, Version 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"_id":"nclosure@0.4.1","_engineSupported":true,"_npmVersion":"0.2.17","_nodeVersion":"v0.3.8-pre","bin":{"ncstyle":"bin/ncstyle.js","nodetestsrunner":"bin/nodetestsrunner.js","closure.json":"bin/closure.json","nodetestinstance":"bin/nodetestinstance.js","ncdoc":"bin/ncdoc.js","deps":"bin/deps.js","nctest":"bin/nctest.js","nccompile":"bin/nccompile.js"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"051e5393c1777454d647d35591ef93eefea2311f","tarball":"https://registry.npmjs.org/nclosure/-/nclosure-0.4.1.tgz","integrity":"sha512-40JSLQUxFI6+OlNmK+EI7FZlmXTt2JH/FKOid/AJX7l/wm481XxuCZqOU+GA84Zo1w4/nteidrX3uzNvaL2FNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5qz5N+FKtdO2u7uwiZn0h8cTUQt88rDYO3mc0n+SLiAIhAMeIWgvvbBpuXOweSLdQvyrrho89iqbqP7adRe86uXLc"}]}},"0.4.2":{"name":"nclosure","description":"Server-side Google Closure with Node.js","author":{"name":"Guido Tapia","email":"guido@tapia.com.au"},"url":"https://github.com/gatapia/nclosure","directories":{"lib":"./third_party","bin":"./bin","example":"./examples"},"dependencies":{"cli":"*"},"main":"./lib/nclosure","version":"0.4.2","engines":{"node":">=0.3.0-pre"},"repository":{"type":"git","url":"git://github.com/gatapia/nclosure.git"},"licenses":[{"type":"Apache License, Version 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"_id":"nclosure@0.4.2","_engineSupported":true,"_npmVersion":"0.2.17","_nodeVersion":"v0.3.8-pre","bin":{"ncstyle":"bin/ncstyle.js","nodetestsrunner":"bin/nodetestsrunner.js","closure.json":"bin/closure.json","nodetestinstance":"bin/nodetestinstance.js","ncdoc":"bin/ncdoc.js","deps":"bin/deps.js","nctest":"bin/nctest.js","nccompile":"bin/nccompile.js"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"a19e645836298848bec88e918b368b61b80884c6","tarball":"https://registry.npmjs.org/nclosure/-/nclosure-0.4.2.tgz","integrity":"sha512-1sYxgzb7fH5zCaTu7/dJmWlmCy6XFLV2KVEJ0wsnYUfaFhIoVqcehRkl/YxruqN8yWErGhkgyXsdxfV//eM56Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOf6wrqOErNZLSYMwBxWmEHC78VApD+tX81TUBuSQatQIhAO8Pk6HSnvyJZA0oOX07g/lMpVoc91MxI1HXXMS2qJov"}]}},"0.4.3":{"name":"nclosure","description":"Server-side Google Closure with Node.js","author":{"name":"Guido Tapia","email":"guido@tapia.com.au"},"url":"https://github.com/gatapia/nclosure","directories":{"lib":"./third_party","bin":"./bin","example":"./examples"},"dependencies":{"cli":"*"},"main":"./lib/nclosure","version":"0.4.3","engines":{"node":">=0.3.0-pre"},"repository":{"type":"git","url":"git://github.com/gatapia/nclosure.git"},"licenses":[{"type":"Apache License, Version 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"bin":{"closure.json":"bin\\closure.json","deps.js":"bin\\deps.js","nccompile.js":"bin\\nccompile.js","ncdoc.js":"bin\\ncdoc.js","ncstyle.js":"bin\\ncstyle.js","nctest.js":"bin\\nctest.js","nodetestinstance.js":"bin\\nodetestinstance.js","nodetestsrunner.js":"bin\\nodetestsrunner.js"},"readme":"# nclosure: Server Side Google Closure Tools in Node.js\r\n\r\n## Overview\r\n\r\nThe [Google Closure Tools](http://code.google.com/closure/) are a powerful set\r\nof utilities that aim to make large scale JavaScript development more\r\nmanageable.  This project brings the power of the closure tools to the\r\n[node](http://www.nodejs.org)\r\nplatform. The closure tools gives developers the utilities required to improve\r\ncode design and maintainability by providing support for:\r\n\r\n* Enhanced Modularisation (Both logically and physically)\r\n* Better Encapsulation\r\n* Type Safety\r\n* Interfaces and Mixins\r\n* Rich Source Documentation\r\n* A Huge Library of Production Ready Utilities, including:\r\n\t* Collections / Arrays\r\n\t* Testing / Mocking\r\n\t* Async Development\r\n\t* Encryption\r\n\t* Date / Date Range Support\r\n\t* Events\r\n\t* Internationalisation\r\n\t* Locale\r\n\t* Math\r\n\t* String\r\n\t* Structs\r\n\t* [More...](http://closure-library.googlecode.com/svn/docs/index.html)\r\n\r\n\r\n## Installation (core)\r\n\r\n* Install `nclosure`.  By:\r\n\r\n\t\t\tnpm install nclosure\r\n\r\n* Or better yet, by getting the source:\r\n\r\n\t\t\tgit clone git://github.com/gatapia/nclosure.git\r\n\t\t\tcd nclosure\r\n\t\t\tnpm link   NOTE: npm link does not work on windows! :(\r\n\r\n## Closure Library\r\n\r\nFor full details on utilities provided in the closure library refer to the\r\n[official docs](http://closure-library.googlecode.com/svn/docs/index.html).\r\nTo use any utility provided in the closure library just:\r\n\r\n1. Include `nclosure` in your application by `require`(ing) it and initialising\r\nit.\r\n\r\n\t\trequire('nclosure').nclosure(); // nclosure() initialises the framework\r\n\r\n2. `goog.require` any namespace from the Closure library.\r\n\r\n        goog.require('goog.structs.Trie');\r\n\r\n3. That's it, use the imported namespaces anywhere in your file.\r\n\r\n        var trie = new goog.structs.Trie();\r\n\r\n## Closure Compiler\r\n\r\nUsing the [Closure Compiler](http://code.google.com/closure/compiler/) requires\r\na small investment in learning but once you have worked your way through the\r\n[docs](http://code.google.com/closure/compiler/) you can take advantage of the\r\ncompiler's support for:\r\n\r\n* Enhanced Code Documentation\r\n* Type Safety\r\n* Encapsulation\r\n* Modularisation\r\n* Enhanced Inheritance and Interfaces\r\n* Scalability\r\n\r\nOnce your source code is\r\n[annotated](http://code.google.com/closure/compiler/docs/js-for-compiler.html)\r\nand ready for compilation just run the following command:\r\n\r\n\t\tnccompile source.js\r\n\r\nThe `nccompile` command accepts various arguments:\r\n\r\n* -c: Create [C]ompile file - Produces a compiled <filename>.min.js file.\r\n  Running your code using the compiled js file optimises your code and\r\n  reduces the number of imports your system does hence improving start up\r\n  time.\r\n* -d: Create [D]ependencies- Creates a deps.js file that can be used as an\r\n  additionalDeps in an external project.\r\n\r\n## JSDoc Documentation\r\n\r\nTo run `nclosure`'s documentation tool simply run:\r\n\r\n    ncdoc <directory or source file>\r\n\r\nFor full documentation details please read the\r\n[official jsdoc-toolkit docs](://code.google.com/p/jsdoc-toolkit/).\r\n\r\nFor a sample source code documentation project using nclosure ncdoc see\r\nthe [node.js core libs](http://gatapia.github.com/ncnode/) as they would look\r\nif generated by nclosure.\r\n\r\n## Closure Testing\r\n\r\n`nclosure` supports testing using Closure's 'goog.testing.jsunit' test tools.\r\nTo set up a unit test simply create a test file like:\r\n\r\n    #!/usr/bin/env node\r\n    // You can now run the test just by executing this file\r\n    require('nclosure').nclosure();\r\n\r\n    goog.require('goog.testing.jsunit');\r\n    // Import the code you are testing (may need an additionalDeps defined)\r\n    goog.require('nclosure.examples.simple.Example');\r\n\r\n    // Any testXXX function are auto-discovered and run\r\n    var testFunction1 = function() {\r\n      assertNotEquals(typeof(example_), 'undefined');\r\n    };\r\n\r\n    // Also auto discovered\r\n    function testFunction2() {\r\n      assertTrue(false);\r\n    }\r\n\r\nIf the tests are not in the same directory as your code you will have to\r\nensure that the deps.js file of the code you are testing\r\nis declared in the closure.json file of the tests directory or passed in to the\r\ncall to `nclosure();` like:\r\n\r\n    require('nclosure').nclosure({additionalDeps:['/pathToDeps/deps.js']});\r\n\r\nTo run a single test just execute:\r\n\r\n    ./testSourceFile.js <optionalTestName>\r\n\r\nTo run all tests (files with the word test or suite in them) in a single\r\ndirectory (recursive) run the following command:\r\n\r\n      nctest <dirname>\r\n\r\nThe testing framework also supports test suite files.  If you want to have a\r\ntest suite simply have an array var named suite with the files to test\r\n(relative to the suite file).  I.e.\r\n\r\n      // Run all the tests inside the '../examples/simple/' directory\r\n      // This array can be directories or specific test (or other suite)\r\n      // files\r\n      var suite = ['../examples/simple/'];\r\n\r\n## Closure Linter\r\n\r\nFor detailed code style checking you can also use `nclosure`'s\r\nlinter support.  To use linter you will need to download and install\r\n[Closure Linter](http://code.google.com/closure/utilities/index.html).\r\n\r\nClosure Linter checks your code against Google's own\r\n[JavaScript Style Guide](http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml)\r\nwhich is a mature and highly scalable framework for developing JavaScript code.\r\n\r\nTo install Closure Linter read the following\r\n[page]( http://code.google.com/closure/utilities/docs/linter_howto.html).\r\n\r\nOnce installed simply run the following command to `linter` your code.\r\n\r\n\t\tncstyle <directory>\r\n\r\n## Node Wrappers\r\n\r\nNClosure contains a set of wrappers around the core node.js libraries.  These\r\nwrappers can be used to give type safety when using these libraries. Eg:\r\n\r\n    goog.provide('namespace');\r\n\r\n    // Import the 'node.fs' namespace. All node core libs live inside the\r\n    // 'node' namespace.\r\n    goog.require('node.fs');\r\n\r\n    console.log('Files: ' + node.fs.readdirSync('.'));\r\n\r\n## Advanced Configuration\r\n\r\n`nclosure` can be configured in several ways.  The easiest is to modify the\r\n`bin/closure.json` file with your global settings.  Settings here can be\r\nextended by placing a `closure.json` file in your source directory. You can\r\nalso place a `closure.json` in the directory running `node` (The cwd).\r\n\r\nFinally, `nclosure` can also be configured by passing an optional options\r\nobject to the `require('nclosure').nclosure(opts);` call.\r\n\r\nAll configuration files and configuration objects take the following format:\r\n\r\n        {\r\n          closureBasePath: Location of the closure-library.  This defaults to\r\n            the closure library included in this package.\r\n          additionalDeps: Any additional dependency files required to run your\r\n            code.  These files generally point to other closure libraries.\r\n            Note these deps files must have paths relative to this setting\r\n            file or be absolute.\r\n          compiler_jar: Path to the compiler jar you want to use.  This defaults\r\n            to the included compiler.jar file so only change this if you want\r\n            to use a custom compiler.\r\n          additionalCompileOptions: Additional compiler options,\r\n            e.g.: \"['--jscomp_warning=newWarningType']\"\r\n          additionalCompileRoots: These are directories containing source code\r\n            that needs to be included in the compilation.  If this is not\r\n            included then additionalDeps is used to try to guess any additional\r\n            roots required (assumes that the deps.js file is in the root folder\r\n            of the source directory).\r\n          jsdocToolkitDir: The location of jsdoc-toolkit.  This is only required\r\n            if you want to use jsdoc-toolkit to document your source code. This\r\n            defaults to the jsdoc instance included in this package.\r\n          additionalJSDocToolkitOptions: Additional jsdoc-toolkit options,\r\n            e.g.: \"['-D=\"noGlobal:true\"']\"\r\n          additionalLinterOptions: Additional gjslint and fixjsstyle options,\r\n            e.g.: \"['--summary=true']\"\r\n          nodeDir: The location of the node source code.  This is only required\r\n            if you are contributing to the nclosure project or would like to\r\n            update your node-extern files.\r\n        }\r\n\r\nNote: All paths can be absolute or relative to the location of the current\r\nsettings file.\r\n\r\n## More Help\r\n\r\nThe best way to get going with nclosure is to look at the nclosure code (bin,\r\nlib and examples directories).  All nclosure code is annotated and should\r\ngive you a good introduction to what can be acchieved with the tool.\r\n\r\nIf you have any questions, issues, complaints, suggestions, .... just email me\r\n(guido@tapia.com.au) and I'll see what I can do to help.\r\n\r\n## Known Limitations\r\n\r\nSince the Node.js core libs are not jsdoc'ed in any way I could not give any\r\ntype safety when using these core libs.\r\n\r\nThe documentation template is lacking in several areas this will be improved\r\nin the future.\r\n\r\nLinter is a pain to instal.\r\n\r\nPoor project documentation.\r\n\r\nFor an up to date list of issues see the TODO.txt file.  Later I will start an\r\nissues list on github.\r\n\r\n## License\r\n\r\nCopyright 2011 Guido Tapia (guido@tapia.com.au)\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\nhttp://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n","_id":"nclosure@0.4.3","dist":{"shasum":"c8c0d7737f99c7a3edc651ac193a35ff716cce2b","tarball":"https://registry.npmjs.org/nclosure/-/nclosure-0.4.3.tgz","integrity":"sha512-9ugChkiwT9H0jVJPOvDn1XtoG7/x1gOWZkBVPX8H0AKw1gZN5qXNkbeopzrU43k8H/uyTlB6uXo4AU5O5ph4tQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID2qaIg8aWoFwZJs6tdaxfDZD68PLX6FeqJkeEMkMPDqAiEA4ePw7/o8hlAPBhS25Amz/mbsNTQvTPF+2ML0GtZJqBw="}]},"maintainers":[{"name":"gatapia","email":"guido@tapia.com.au"},{"name":"bitwiseman","email":"bitwiseman@gmail.com"}]}},"maintainers":[{"name":"gatapia","email":"guido@tapia.com.au"},{"name":"bitwiseman","email":"bitwiseman@gmail.com"}],"time":{"modified":"2022-06-20T22:36:48.248Z","created":"2011-02-15T01:50:38.686Z","0.3.1":"2011-02-15T01:50:39.568Z","0.4.0":"2011-02-25T05:59:59.179Z","0.4.1":"2011-02-25T09:30:41.436Z","0.4.2":"2011-03-05T10:29:45.829Z","0.4.3":"2012-07-16T18:44:49.515Z"},"author":{"name":"Guido Tapia","email":"guido@tapia.com.au"},"repository":{"type":"git","url":"git://github.com/gatapia/nclosure.git"}}