├── .gitattributes ├── .gitignore ├── .travis.yml ├── DemoPicture.png ├── License.md ├── README.md ├── compilex.js ├── cppModule.js ├── csModule.js ├── examples └── compilex-Demo1 │ ├── TestSnippets.txt │ ├── index.html │ ├── node_modules │ ├── body-parser │ │ ├── .npmignore │ │ ├── HISTORY.md │ │ ├── README.md │ │ ├── index.js │ │ ├── node_modules │ │ │ ├── bytes │ │ │ │ ├── .npmignore │ │ │ │ ├── History.md │ │ │ │ ├── Makefile │ │ │ │ ├── Readme.md │ │ │ │ ├── component.json │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ ├── qs │ │ │ │ ├── .gitmodules │ │ │ │ ├── .npmignore │ │ │ │ ├── Readme.md │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ ├── raw-body │ │ │ │ ├── .npmignore │ │ │ │ ├── .travis.yml │ │ │ │ ├── Makefile │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ ├── node_modules │ │ │ │ │ └── bytes │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ └── package.json │ │ │ │ └── package.json │ │ │ └── type-is │ │ │ │ ├── .npmignore │ │ │ │ ├── HISTORY.md │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ ├── node_modules │ │ │ │ └── mime │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── mime.js │ │ │ │ │ ├── package.json │ │ │ │ │ ├── test.js │ │ │ │ │ └── types │ │ │ │ │ ├── mime.types │ │ │ │ │ └── node.types │ │ │ │ └── package.json │ │ └── package.json │ └── compilex │ │ ├── .gitattributes │ │ ├── .npmignore │ │ ├── .travis.yml │ │ ├── DemoPicture.png │ │ ├── License.md │ │ ├── README.md │ │ ├── compilex.js │ │ ├── cppModule.js │ │ ├── csModule.js │ │ ├── examples │ │ └── compilex-Demo1 │ │ │ ├── TestSnippets.txt │ │ │ ├── index.html │ │ │ ├── node_modules │ │ │ ├── body-parser │ │ │ │ ├── .npmignore │ │ │ │ ├── HISTORY.md │ │ │ │ ├── README.md │ │ │ │ ├── index.js │ │ │ │ ├── node_modules │ │ │ │ │ ├── bytes │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── qs │ │ │ │ │ │ ├── .gitmodules │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── raw-body │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ │ └── bytes │ │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ │ ├── History.md │ │ │ │ │ │ │ │ ├── Makefile │ │ │ │ │ │ │ │ ├── Readme.md │ │ │ │ │ │ │ │ ├── component.json │ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ └── package.json │ │ │ │ │ └── type-is │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ ├── HISTORY.md │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ ├── node_modules │ │ │ │ │ │ └── mime │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ ├── mime.js │ │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ │ ├── test.js │ │ │ │ │ │ │ └── types │ │ │ │ │ │ │ ├── mime.types │ │ │ │ │ │ │ └── node.types │ │ │ │ │ │ └── package.json │ │ │ │ └── package.json │ │ │ └── compilex │ │ │ │ ├── .gitattributes │ │ │ │ ├── .npmignore │ │ │ │ ├── License.md │ │ │ │ ├── README.md │ │ │ │ ├── compilex.js │ │ │ │ ├── cppModule.js │ │ │ │ ├── javaModule.js │ │ │ │ ├── package.json │ │ │ │ └── pyModule.js │ │ │ └── server.js │ │ ├── javaModule.js │ │ ├── node_modules │ │ ├── colors │ │ │ ├── MIT-LICENSE.txt │ │ │ ├── ReadMe.md │ │ │ ├── colors.js │ │ │ ├── example.html │ │ │ ├── example.js │ │ │ ├── package.json │ │ │ ├── test.js │ │ │ └── themes │ │ │ │ ├── winston-dark.js │ │ │ │ └── winston-light.js │ │ └── cuid │ │ │ ├── .npmignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.markdown │ │ │ ├── component.json │ │ │ ├── grunt.js │ │ │ ├── lib │ │ │ ├── applitude.bundle.js │ │ │ ├── applitude.js │ │ │ └── jquery.js │ │ │ ├── package.json │ │ │ ├── src │ │ │ ├── browser-fingerprint.js │ │ │ ├── footer.js │ │ │ ├── head.js │ │ │ └── node-fingerprint.js │ │ │ └── test │ │ │ ├── applitude-cuid-test.html │ │ │ ├── applitude-cuid-test.js │ │ │ ├── browser-cuid-test.html │ │ │ ├── browser-cuid-test.js │ │ │ ├── node-cuid-test.js │ │ │ ├── qunit.css │ │ │ ├── qunit.js │ │ │ └── testling.js │ │ ├── package.json │ │ ├── pyModule.js │ │ └── vbModule.js │ └── server.js ├── javaModule.js ├── node_modules ├── colors │ ├── MIT-LICENSE.txt │ ├── ReadMe.md │ ├── colors.js │ ├── example.html │ ├── example.js │ ├── package.json │ ├── test.js │ └── themes │ │ ├── winston-dark.js │ │ └── winston-light.js └── cuid │ ├── .npmignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.markdown │ ├── component.json │ ├── grunt.js │ ├── lib │ ├── applitude.bundle.js │ ├── applitude.js │ └── jquery.js │ ├── package.json │ ├── src │ ├── browser-fingerprint.js │ ├── footer.js │ ├── head.js │ └── node-fingerprint.js │ └── test │ ├── applitude-cuid-test.html │ ├── applitude-cuid-test.js │ ├── browser-cuid-test.html │ ├── browser-cuid-test.js │ ├── node-cuid-test.js │ ├── qunit.css │ ├── qunit.js │ └── testling.js ├── package.json ├── pyModule.js └── vbModule.js /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | 46 | [Dd]ebug/ 47 | [Rr]elease/ 48 | x64/ 49 | build/ 50 | [Bb]in/ 51 | [Oo]bj/ 52 | 53 | # MSTest test Results 54 | [Tt]est[Rr]esult*/ 55 | [Bb]uild[Ll]og.* 56 | 57 | *_i.c 58 | *_p.c 59 | *.ilk 60 | *.meta 61 | *.obj 62 | *.pch 63 | *.pdb 64 | *.pgc 65 | *.pgd 66 | *.rsp 67 | *.sbr 68 | *.tlb 69 | *.tli 70 | *.tlh 71 | *.tmp 72 | *.tmp_proj 73 | *.log 74 | *.vspscc 75 | *.vssscc 76 | .builds 77 | *.pidb 78 | *.log 79 | *.scc 80 | 81 | # Visual C++ cache files 82 | ipch/ 83 | *.aps 84 | *.ncb 85 | *.opensdf 86 | *.sdf 87 | *.cachefile 88 | 89 | # Visual Studio profiler 90 | *.psess 91 | *.vsp 92 | *.vspx 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | 101 | # TeamCity is a build add-in 102 | _TeamCity* 103 | 104 | # DotCover is a Code Coverage Tool 105 | *.dotCover 106 | 107 | # NCrunch 108 | *.ncrunch* 109 | .*crunch*.local.xml 110 | 111 | # Installshield output folder 112 | [Ee]xpress/ 113 | 114 | # DocProject is a documentation generator add-in 115 | DocProject/buildhelp/ 116 | DocProject/Help/*.HxT 117 | DocProject/Help/*.HxC 118 | DocProject/Help/*.hhc 119 | DocProject/Help/*.hhk 120 | DocProject/Help/*.hhp 121 | DocProject/Help/Html2 122 | DocProject/Help/html 123 | 124 | # Click-Once directory 125 | publish/ 126 | 127 | # Publish Web Output 128 | *.Publish.xml 129 | *.pubxml 130 | 131 | # NuGet Packages Directory 132 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 133 | #packages/ 134 | 135 | # Windows Azure Build Output 136 | csx 137 | *.build.csdef 138 | 139 | # Windows Store app package directory 140 | AppPackages/ 141 | 142 | # Others 143 | sql/ 144 | *.Cache 145 | ClientBin/ 146 | [Ss]tyle[Cc]op.* 147 | ~$* 148 | *~ 149 | *.dbmdl 150 | *.[Pp]ublish.xml 151 | *.pfx 152 | *.publishsettings 153 | 154 | # RIA/Silverlight projects 155 | Generated_Code/ 156 | 157 | # Backup & report files from converting an old project file to a newer 158 | # Visual Studio version. Backup files are not needed, because we have git ;-) 159 | _UpgradeReport_Files/ 160 | Backup*/ 161 | UpgradeLog*.XML 162 | UpgradeLog*.htm 163 | 164 | # SQL Server files 165 | App_Data/*.mdf 166 | App_Data/*.ldf 167 | 168 | ############# 169 | ## Windows detritus 170 | ############# 171 | 172 | # Windows image file caches 173 | Thumbs.db 174 | ehthumbs.db 175 | 176 | # Folder config file 177 | Desktop.ini 178 | 179 | # Recycle Bin used on file shares 180 | $RECYCLE.BIN/ 181 | 182 | # Mac crap 183 | .DS_Store 184 | 185 | 186 | ############# 187 | ## Python 188 | ############# 189 | 190 | *.py[co] 191 | 192 | # Packages 193 | *.egg 194 | *.egg-info 195 | dist/ 196 | build/ 197 | eggs/ 198 | parts/ 199 | var/ 200 | sdist/ 201 | develop-eggs/ 202 | .installed.cfg 203 | 204 | # Installer logs 205 | pip-log.txt 206 | 207 | # Unit test / coverage reports 208 | .coverage 209 | .tox 210 | 211 | #Translations 212 | *.mo 213 | 214 | #Mr Developer 215 | .mr.developer.cfg 216 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | - "0.11" 5 | matrix: 6 | allow_failures: 7 | - node_js: "0.11" 8 | fast_finish: true 9 | script: "npm run-script test-travis" -------------------------------------------------------------------------------- /DemoPicture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptnull/compilex/afb74a011b9297087c5446720271bef837325784/DemoPicture.png -------------------------------------------------------------------------------- /License.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright (c) 2014 Vishnu Bharathi 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. -------------------------------------------------------------------------------- /examples/compilex-Demo1/TestSnippets.txt: -------------------------------------------------------------------------------- 1 | C 2 | == 3 | 4 | #include 5 | int main() 6 | { 7 | printf("Hello World from C"); 8 | return 0; 9 | } 10 | 11 | #include 12 | int main() 13 | { 14 | int a , b, c ; 15 | scanf("%d",&a); 16 | scanf("%d",&b); 17 | c = a + b ; 18 | printf("%d",c); 19 | return 0; 20 | } 21 | 22 | @@@@@@@@@@@@@@@@@@@@@@@@ 23 | 24 | C++ 25 | === 26 | #include 27 | using namespace std; 28 | int main() 29 | { 30 | cout<<"Hello World from C++"; 31 | return 0; 32 | } 33 | 34 | #include 35 | using namespace std; 36 | int main() 37 | { 38 | int a , b, c ; 39 | cin>>a; 40 | cin>>b; 41 | c = a + b ; 42 | cout< 3 | 4 | Compilex 5 | 6 | 7 |
8 |

Compilex Demo

9 |
10 |

Code

11 | 12 |
13 |

Input

14 | 15 |
16 | Language : 24 | Compile With Input : 25 | yes 26 | No 27 |
28 | 29 |
30 |
31 | 32 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/.npmignore: -------------------------------------------------------------------------------- 1 | test/ 2 | .travis.yml 3 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.2.1 / 2014-05-26 2 | ================== 3 | 4 | * invoke `next(err)` after request fully read 5 | - prevents hung responses and socket hang ups 6 | 7 | 1.2.0 / 2014-05-11 8 | ================== 9 | 10 | * add `verify` option 11 | * deps: type-is@1.2.0 12 | - support suffix matching 13 | 14 | 1.1.2 / 2014-05-11 15 | ================== 16 | 17 | * improve json parser speed 18 | 19 | 1.1.1 / 2014-05-11 20 | ================== 21 | 22 | * fix repeated limit parsing with every request 23 | 24 | 1.1.0 / 2014-05-10 25 | ================== 26 | 27 | * add `type` option 28 | * deps: pin for safety and consistency 29 | 30 | 1.0.2 / 2014-04-14 31 | ================== 32 | 33 | * use `type-is` module 34 | 35 | 1.0.1 / 2014-03-20 36 | ================== 37 | 38 | * lower default limits to 100kb 39 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/bytes/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/bytes/History.md: -------------------------------------------------------------------------------- 1 | 2 | 1.0.0 / 2014-05-05 3 | ================== 4 | 5 | * add negative support. fixes #6 6 | 7 | 0.3.0 / 2014-03-19 8 | ================== 9 | 10 | * added terabyte support 11 | 12 | 0.2.1 / 2013-04-01 13 | ================== 14 | 15 | * add .component 16 | 17 | 0.2.0 / 2012-10-28 18 | ================== 19 | 20 | * bytes(200).should.eql('200b') 21 | 22 | 0.1.0 / 2012-07-04 23 | ================== 24 | 25 | * add bytes to string conversion [yields] 26 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/bytes/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha \ 4 | --reporter spec \ 5 | --require should 6 | 7 | .PHONY: test -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/bytes/Readme.md: -------------------------------------------------------------------------------- 1 | # node-bytes 2 | 3 | Byte string parser / formatter. 4 | 5 | ## Example: 6 | 7 | ```js 8 | bytes('1kb') 9 | // => 1024 10 | 11 | bytes('2mb') 12 | // => 2097152 13 | 14 | bytes('1gb') 15 | // => 1073741824 16 | 17 | bytes(1073741824) 18 | // => 1gb 19 | 20 | bytes(1099511627776) 21 | // => 1tb 22 | ``` 23 | 24 | ## Installation 25 | 26 | ``` 27 | $ npm install bytes 28 | $ component install visionmedia/bytes.js 29 | ``` 30 | 31 | ## License 32 | 33 | (The MIT License) 34 | 35 | Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca> 36 | 37 | Permission is hereby granted, free of charge, to any person obtaining 38 | a copy of this software and associated documentation files (the 39 | 'Software'), to deal in the Software without restriction, including 40 | without limitation the rights to use, copy, modify, merge, publish, 41 | distribute, sublicense, and/or sell copies of the Software, and to 42 | permit persons to whom the Software is furnished to do so, subject to 43 | the following conditions: 44 | 45 | The above copyright notice and this permission notice shall be 46 | included in all copies or substantial portions of the Software. 47 | 48 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 49 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 50 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 51 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 52 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 53 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 54 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 55 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/bytes/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bytes", 3 | "description": "byte size string parser / serializer", 4 | "keywords": ["bytes", "utility"], 5 | "version": "0.2.1", 6 | "scripts": ["index.js"] 7 | } 8 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/bytes/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Parse byte `size` string. 4 | * 5 | * @param {String} size 6 | * @return {Number} 7 | * @api public 8 | */ 9 | 10 | module.exports = function(size) { 11 | if ('number' == typeof size) return convert(size); 12 | var parts = size.match(/^(\d+(?:\.\d+)?) *(kb|mb|gb|tb)$/) 13 | , n = parseFloat(parts[1]) 14 | , type = parts[2]; 15 | 16 | var map = { 17 | kb: 1 << 10 18 | , mb: 1 << 20 19 | , gb: 1 << 30 20 | , tb: ((1 << 30) * 1024) 21 | }; 22 | 23 | return map[type] * n; 24 | }; 25 | 26 | /** 27 | * convert bytes into string. 28 | * 29 | * @param {Number} b - bytes to convert 30 | * @return {String} 31 | * @api public 32 | */ 33 | 34 | function convert (b) { 35 | var tb = ((1 << 30) * 1024), gb = 1 << 30, mb = 1 << 20, kb = 1 << 10, abs = Math.abs(b); 36 | if (abs >= tb) return (Math.round(b / tb * 100) / 100) + 'tb'; 37 | if (abs >= gb) return (Math.round(b / gb * 100) / 100) + 'gb'; 38 | if (abs >= mb) return (Math.round(b / mb * 100) / 100) + 'mb'; 39 | if (abs >= kb) return (Math.round(b / kb * 100) / 100) + 'kb'; 40 | return b + 'b'; 41 | } 42 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/bytes/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bytes", 3 | "author": { 4 | "name": "TJ Holowaychuk", 5 | "email": "tj@vision-media.ca", 6 | "url": "http://tjholowaychuk.com" 7 | }, 8 | "description": "byte size string parser / serializer", 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/visionmedia/bytes.js.git" 12 | }, 13 | "version": "1.0.0", 14 | "main": "index.js", 15 | "dependencies": {}, 16 | "devDependencies": { 17 | "mocha": "*", 18 | "should": "*" 19 | }, 20 | "component": { 21 | "scripts": { 22 | "bytes/index.js": "index.js" 23 | } 24 | }, 25 | "readme": "# node-bytes\n\n Byte string parser / formatter.\n\n## Example:\n\n```js\nbytes('1kb')\n// => 1024\n\nbytes('2mb')\n// => 2097152\n\nbytes('1gb')\n// => 1073741824\n\nbytes(1073741824)\n// => 1gb\n\nbytes(1099511627776)\n// => 1tb\n```\n\n## Installation\n\n```\n$ npm install bytes\n$ component install visionmedia/bytes.js\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", 26 | "readmeFilename": "Readme.md", 27 | "bugs": { 28 | "url": "https://github.com/visionmedia/bytes.js/issues" 29 | }, 30 | "homepage": "https://github.com/visionmedia/bytes.js", 31 | "_id": "bytes@1.0.0", 32 | "_from": "bytes@1.0.0" 33 | } 34 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/qs/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "support/expresso"] 2 | path = support/expresso 3 | url = git://github.com/visionmedia/expresso.git 4 | [submodule "support/should"] 5 | path = support/should 6 | url = git://github.com/visionmedia/should.js.git 7 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/qs/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | .travis.yml 3 | benchmark.js 4 | component.json 5 | examples.js 6 | History.md 7 | Makefile 8 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/qs/Readme.md: -------------------------------------------------------------------------------- 1 | # node-querystring 2 | 3 | query string parser for node and the browser supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others. 4 | 5 | ## Installation 6 | 7 | $ npm install qs 8 | 9 | ## Examples 10 | 11 | ```js 12 | var qs = require('qs'); 13 | 14 | qs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com'); 15 | // => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } } 16 | 17 | qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }}) 18 | // => user[name]=Tobi&user[email]=tobi%40learnboost.com 19 | ``` 20 | 21 | ## Testing 22 | 23 | Install dev dependencies: 24 | 25 | $ npm install -d 26 | 27 | and execute: 28 | 29 | $ make test 30 | 31 | browser: 32 | 33 | $ open test/browser/index.html 34 | 35 | ## License 36 | 37 | (The MIT License) 38 | 39 | Copyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca> 40 | 41 | Permission is hereby granted, free of charge, to any person obtaining 42 | a copy of this software and associated documentation files (the 43 | 'Software'), to deal in the Software without restriction, including 44 | without limitation the rights to use, copy, modify, merge, publish, 45 | distribute, sublicense, and/or sell copies of the Software, and to 46 | permit persons to whom the Software is furnished to do so, subject to 47 | the following conditions: 48 | 49 | The above copyright notice and this permission notice shall be 50 | included in all copies or substantial portions of the Software. 51 | 52 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 53 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 54 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 55 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 56 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 57 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 58 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/qs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "qs", 3 | "description": "querystring parser", 4 | "version": "0.6.6", 5 | "keywords": [ 6 | "query string", 7 | "parser", 8 | "component" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "git://github.com/visionmedia/node-querystring.git" 13 | }, 14 | "devDependencies": { 15 | "mocha": "*", 16 | "expect.js": "*" 17 | }, 18 | "scripts": { 19 | "test": "make test" 20 | }, 21 | "author": { 22 | "name": "TJ Holowaychuk", 23 | "email": "tj@vision-media.ca", 24 | "url": "http://tjholowaychuk.com" 25 | }, 26 | "main": "index", 27 | "engines": { 28 | "node": "*" 29 | }, 30 | "readme": "# node-querystring\n\n query string parser for node and the browser supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others.\n\n## Installation\n\n $ npm install qs\n\n## Examples\n\n```js\nvar qs = require('qs');\n\nqs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com');\n// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } }\n\nqs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }})\n// => user[name]=Tobi&user[email]=tobi%40learnboost.com\n```\n\n## Testing\n\nInstall dev dependencies:\n\n $ npm install -d\n\nand execute:\n\n $ make test\n\nbrowser:\n\n $ open test/browser/index.html\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", 31 | "readmeFilename": "Readme.md", 32 | "bugs": { 33 | "url": "https://github.com/visionmedia/node-querystring/issues" 34 | }, 35 | "homepage": "https://github.com/visionmedia/node-querystring", 36 | "_id": "qs@0.6.6", 37 | "_from": "qs@0.6.6" 38 | } 39 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/.npmignore: -------------------------------------------------------------------------------- 1 | test/ -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/.travis.yml: -------------------------------------------------------------------------------- 1 | node_js: 2 | - "0.8" 3 | - "0.10" 4 | - "0.11" 5 | language: node_js -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/Makefile: -------------------------------------------------------------------------------- 1 | NODE ?= node 2 | BIN = ./node_modules/.bin/ 3 | 4 | test: 5 | @${NODE} ${BIN}mocha \ 6 | --harmony-generators \ 7 | --reporter spec \ 8 | --bail \ 9 | ./test/index.js 10 | 11 | clean: 12 | @rm -rf node_modules 13 | 14 | .PHONY: test clean 15 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/README.md: -------------------------------------------------------------------------------- 1 | # Raw Body [![Build Status](https://travis-ci.org/stream-utils/raw-body.svg?branch=master)](https://travis-ci.org/stream-utils/raw-body) 2 | 3 | Gets the entire buffer of a stream either as a `Buffer` or a string. 4 | Validates the stream's length against an expected length and maximum limit. 5 | Ideal for parsing request bodies. 6 | 7 | ## API 8 | 9 | ```js 10 | var getRawBody = require('raw-body') 11 | 12 | app.use(function (req, res, next) { 13 | getRawBody(req, { 14 | length: req.headers['content-length'], 15 | limit: '1mb', 16 | encoding: 'utf8' 17 | }, function (err, string) { 18 | if (err) 19 | return next(err) 20 | 21 | req.text = string 22 | next() 23 | }) 24 | }) 25 | ``` 26 | 27 | or in a Koa generator: 28 | 29 | ```js 30 | app.use(function* (next) { 31 | var string = yield getRawBody(this.req, { 32 | length: this.length, 33 | limit: '1mb', 34 | encoding: 'utf8' 35 | }) 36 | }) 37 | ``` 38 | 39 | ### getRawBody(stream, [options], [callback]) 40 | 41 | Returns a thunk for yielding with generators. 42 | 43 | Options: 44 | 45 | - `length` - The length length of the stream. 46 | If the contents of the stream do not add up to this length, 47 | an `400` error code is returned. 48 | - `limit` - The byte limit of the body. 49 | If the body ends up being larger than this limit, 50 | a `413` error code is returned. 51 | - `encoding` - The requested encoding. 52 | By default, a `Buffer` instance will be returned. 53 | Most likely, you want `utf8`. 54 | You can use any type of encoding supported by [StringDecoder](http://nodejs.org/api/string_decoder.html). 55 | You can also pass `true` which sets it to the default `utf8` 56 | 57 | `callback(err, res)`: 58 | 59 | - `err` - the following attributes will be defined if applicable: 60 | 61 | - `limit` - the limit in bytes 62 | - `length` and `expected` - the expected length of the stream 63 | - `received` - the received bytes 64 | - `status` and `statusCode` - the corresponding status code for the error 65 | - `type` - either `entity.too.large`, `request.size.invalid`, or `stream.encoding.set` 66 | 67 | - `res` - the result, either as a `String` if an encoding was set or a `Buffer` otherwise. 68 | 69 | If an error occurs, the stream will be paused, 70 | and you are responsible for correctly disposing the stream. 71 | For HTTP requests, no handling is required if you send a response. 72 | For streams that use file descriptors, you should `stream.destroy()` or `stream.close()` to prevent leaks. 73 | 74 | ## License 75 | 76 | The MIT License (MIT) 77 | 78 | Copyright (c) 2013 Jonathan Ong me@jongleberry.com 79 | 80 | Permission is hereby granted, free of charge, to any person obtaining a copy 81 | of this software and associated documentation files (the "Software"), to deal 82 | in the Software without restriction, including without limitation the rights 83 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 84 | copies of the Software, and to permit persons to whom the Software is 85 | furnished to do so, subject to the following conditions: 86 | 87 | The above copyright notice and this permission notice shall be included in 88 | all copies or substantial portions of the Software. 89 | 90 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 91 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 92 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 93 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 94 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 95 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 96 | THE SOFTWARE. 97 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/node_modules/bytes/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/node_modules/bytes/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.3.0 / 2014-03-19 3 | ================== 4 | 5 | * added terabyte support 6 | 7 | 0.2.1 / 2013-04-01 8 | ================== 9 | 10 | * add .component 11 | 12 | 0.2.0 / 2012-10-28 13 | ================== 14 | 15 | * bytes(200).should.eql('200b') 16 | 17 | 0.1.0 / 2012-07-04 18 | ================== 19 | 20 | * add bytes to string conversion [yields] 21 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/node_modules/bytes/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha \ 4 | --reporter spec \ 5 | --require should 6 | 7 | .PHONY: test -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/node_modules/bytes/Readme.md: -------------------------------------------------------------------------------- 1 | # node-bytes 2 | 3 | Byte string parser / formatter. 4 | 5 | ## Example: 6 | 7 | ```js 8 | bytes('1kb') 9 | // => 1024 10 | 11 | bytes('2mb') 12 | // => 2097152 13 | 14 | bytes('1gb') 15 | // => 1073741824 16 | 17 | bytes(1073741824) 18 | // => 1gb 19 | 20 | bytes(1099511627776) 21 | // => 1tb 22 | ``` 23 | 24 | ## Installation 25 | 26 | ``` 27 | $ npm install bytes 28 | $ component install visionmedia/bytes.js 29 | ``` 30 | 31 | ## License 32 | 33 | (The MIT License) 34 | 35 | Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca> 36 | 37 | Permission is hereby granted, free of charge, to any person obtaining 38 | a copy of this software and associated documentation files (the 39 | 'Software'), to deal in the Software without restriction, including 40 | without limitation the rights to use, copy, modify, merge, publish, 41 | distribute, sublicense, and/or sell copies of the Software, and to 42 | permit persons to whom the Software is furnished to do so, subject to 43 | the following conditions: 44 | 45 | The above copyright notice and this permission notice shall be 46 | included in all copies or substantial portions of the Software. 47 | 48 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 49 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 50 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 51 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 52 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 53 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 54 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 55 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/node_modules/bytes/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bytes", 3 | "description": "byte size string parser / serializer", 4 | "keywords": ["bytes", "utility"], 5 | "version": "0.2.1", 6 | "scripts": ["index.js"] 7 | } 8 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/node_modules/bytes/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Parse byte `size` string. 4 | * 5 | * @param {String} size 6 | * @return {Number} 7 | * @api public 8 | */ 9 | 10 | module.exports = function(size) { 11 | if ('number' == typeof size) return convert(size); 12 | var parts = size.match(/^(\d+(?:\.\d+)?) *(kb|mb|gb|tb)$/) 13 | , n = parseFloat(parts[1]) 14 | , type = parts[2]; 15 | 16 | var map = { 17 | kb: 1 << 10 18 | , mb: 1 << 20 19 | , gb: 1 << 30 20 | , tb: ((1 << 30) * 1024) 21 | }; 22 | 23 | return map[type] * n; 24 | }; 25 | 26 | /** 27 | * convert bytes into string. 28 | * 29 | * @param {Number} b - bytes to convert 30 | * @return {String} 31 | * @api public 32 | */ 33 | 34 | function convert (b) { 35 | var tb = ((1 << 30) * 1024), gb = 1 << 30, mb = 1 << 20, kb = 1 << 10; 36 | if (b >= tb) return (Math.round(b / tb * 100) / 100) + 'tb'; 37 | if (b >= gb) return (Math.round(b / gb * 100) / 100) + 'gb'; 38 | if (b >= mb) return (Math.round(b / mb * 100) / 100) + 'mb'; 39 | if (b >= kb) return (Math.round(b / kb * 100) / 100) + 'kb'; 40 | return b + 'b'; 41 | } 42 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/node_modules/bytes/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bytes", 3 | "author": { 4 | "name": "TJ Holowaychuk", 5 | "email": "tj@vision-media.ca", 6 | "url": "http://tjholowaychuk.com" 7 | }, 8 | "description": "byte size string parser / serializer", 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/visionmedia/bytes.js.git" 12 | }, 13 | "version": "0.3.0", 14 | "main": "index.js", 15 | "dependencies": {}, 16 | "devDependencies": { 17 | "mocha": "*", 18 | "should": "*" 19 | }, 20 | "component": { 21 | "scripts": { 22 | "bytes/index.js": "index.js" 23 | } 24 | }, 25 | "readme": "# node-bytes\n\n Byte string parser / formatter.\n\n## Example:\n\n```js\nbytes('1kb')\n// => 1024\n\nbytes('2mb')\n// => 2097152\n\nbytes('1gb')\n// => 1073741824\n\nbytes(1073741824)\n// => 1gb\n\nbytes(1099511627776)\n// => 1tb\n```\n\n## Installation\n\n```\n$ npm install bytes\n$ component install visionmedia/bytes.js\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", 26 | "readmeFilename": "Readme.md", 27 | "bugs": { 28 | "url": "https://github.com/visionmedia/bytes.js/issues" 29 | }, 30 | "homepage": "https://github.com/visionmedia/bytes.js", 31 | "_id": "bytes@0.3.0", 32 | "_from": "bytes@~0.3.0" 33 | } 34 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "raw-body", 3 | "description": "Get and validate the raw body of a readable stream.", 4 | "version": "1.1.4", 5 | "author": { 6 | "name": "Jonathan Ong", 7 | "email": "me@jongleberry.com", 8 | "url": "http://jongleberry.com" 9 | }, 10 | "license": "MIT", 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/stream-utils/raw-body.git" 14 | }, 15 | "bugs": { 16 | "url": "https://github.com/stream-utils/raw-body/issues" 17 | }, 18 | "dependencies": { 19 | "bytes": "~0.3.0" 20 | }, 21 | "devDependencies": { 22 | "readable-stream": "~1.0.17", 23 | "co": "3", 24 | "gnode": "~0.0.4", 25 | "mocha": "^1.14.0", 26 | "through2": "~0.4.1", 27 | "request": "^2.27.0", 28 | "assert-tap": "~0.1.4" 29 | }, 30 | "scripts": { 31 | "test": "NODE=gnode make test && node ./test/acceptance.js" 32 | }, 33 | "engines": { 34 | "node": ">= 0.8.0" 35 | }, 36 | "readme": "# Raw Body [![Build Status](https://travis-ci.org/stream-utils/raw-body.svg?branch=master)](https://travis-ci.org/stream-utils/raw-body)\n\nGets the entire buffer of a stream either as a `Buffer` or a string.\nValidates the stream's length against an expected length and maximum limit.\nIdeal for parsing request bodies.\n\n## API\n\n```js\nvar getRawBody = require('raw-body')\n\napp.use(function (req, res, next) {\n getRawBody(req, {\n length: req.headers['content-length'],\n limit: '1mb',\n encoding: 'utf8'\n }, function (err, string) {\n if (err)\n return next(err)\n\n req.text = string\n next()\n })\n})\n```\n\nor in a Koa generator:\n\n```js\napp.use(function* (next) {\n var string = yield getRawBody(this.req, {\n length: this.length,\n limit: '1mb',\n encoding: 'utf8'\n })\n})\n```\n\n### getRawBody(stream, [options], [callback])\n\nReturns a thunk for yielding with generators.\n\nOptions:\n\n- `length` - The length length of the stream.\n If the contents of the stream do not add up to this length,\n an `400` error code is returned.\n- `limit` - The byte limit of the body.\n If the body ends up being larger than this limit,\n a `413` error code is returned.\n- `encoding` - The requested encoding.\n By default, a `Buffer` instance will be returned.\n Most likely, you want `utf8`.\n You can use any type of encoding supported by [StringDecoder](http://nodejs.org/api/string_decoder.html).\n You can also pass `true` which sets it to the default `utf8`\n\n`callback(err, res)`:\n\n- `err` - the following attributes will be defined if applicable:\n\n - `limit` - the limit in bytes\n - `length` and `expected` - the expected length of the stream\n - `received` - the received bytes\n - `status` and `statusCode` - the corresponding status code for the error\n - `type` - either `entity.too.large`, `request.size.invalid`, or `stream.encoding.set`\n\n- `res` - the result, either as a `String` if an encoding was set or a `Buffer` otherwise.\n\nIf an error occurs, the stream will be paused,\nand you are responsible for correctly disposing the stream.\nFor HTTP requests, no handling is required if you send a response.\nFor streams that use file descriptors, you should `stream.destroy()` or `stream.close()` to prevent leaks.\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Jonathan Ong me@jongleberry.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", 37 | "readmeFilename": "README.md", 38 | "homepage": "https://github.com/stream-utils/raw-body", 39 | "_id": "raw-body@1.1.4", 40 | "dist": { 41 | "shasum": "5005bcff1db3833b9e60eaad525f496e179bdce1" 42 | }, 43 | "_from": "raw-body@1.1.4", 44 | "_resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.1.4.tgz" 45 | } 46 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/.npmignore: -------------------------------------------------------------------------------- 1 | test.js 2 | .travis.yml 3 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.2.0 / 2014-05-11 2 | ================== 3 | 4 | * support suffix matching: 5 | 6 | - `+json` matches `application/vnd+json` 7 | - `*/vnd+json` matches `application/vnd+json` 8 | - `application/*+json` matches `application/vnd+json` 9 | 10 | 1.1.0 / 2014-04-12 11 | ================== 12 | 13 | * add non-array values support 14 | * expose internal utilities: 15 | 16 | - `.is()` 17 | - `.hasBody()` 18 | - `.normalize()` 19 | - `.match()` 20 | 21 | 1.0.1 / 2014-03-30 22 | ================== 23 | 24 | * add `multipart` as a shorthand 25 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/README.md: -------------------------------------------------------------------------------- 1 | # type-is [![Build Status](https://travis-ci.org/expressjs/type-is.svg?branch=master)](https://travis-ci.org/expressjs/type-is) [![NPM version](https://badge.fury.io/js/type-is.svg)](https://badge.fury.io/js/type-is) 2 | 3 | Infer the content type of a request. 4 | Extracted from [koa](https://github.com/koajs/koa) for general use. 5 | 6 | Here's an example body parser: 7 | 8 | ```js 9 | var is = require('type-is'); 10 | var parse = require('body'); 11 | var busboy = require('busboy'); 12 | 13 | function bodyParser(req, res, next) { 14 | var hasRequestBody = 'content-type' in req.headers 15 | || 'transfer-encoding' in req.headers; 16 | if (!hasRequestBody) return next(); 17 | 18 | switch (is(req, ['urlencoded', 'json', 'multipart'])) { 19 | case 'urlencoded': 20 | // parse urlencoded body 21 | break 22 | case 'json': 23 | // parse json body 24 | break 25 | case 'multipart': 26 | // parse multipart body 27 | break 28 | default: 29 | // 415 error code 30 | } 31 | } 32 | ``` 33 | 34 | ## API 35 | 36 | ### var type = is(request, types) 37 | 38 | ```js 39 | var is = require('type-is') 40 | 41 | http.createServer(function (req, res) { 42 | is(req, ['text/*']) 43 | }) 44 | ``` 45 | 46 | `request` is the node HTTP request. `types` is an array of types. Each type can be: 47 | 48 | - An extension name such as `json`. This name will be returned if matched. 49 | - A mime type such as `application/json`. 50 | - A mime type with a wildcard such as `*/json` or `application/*`. The full mime type will be returned if matched 51 | - A suffix such as `+json`. This can be combined with a wildcard such as `*/vnd+json` or `application/*+json`. The full mime type will be returned if matched. 52 | 53 | `false` will be returned if no type matches. 54 | 55 | Examples: 56 | 57 | ```js 58 | // req.headers.content-type = 'application/json' 59 | is(req, ['json']) // -> 'json' 60 | is(req, ['html', 'json']) // -> 'json' 61 | is(req, ['application/*']) // -> 'application/json' 62 | is(req, ['application/json']) // -> 'application/json' 63 | is(req, ['html']) // -> false 64 | ``` 65 | 66 | ## License 67 | 68 | The MIT License (MIT) 69 | 70 | Copyright (c) 2013 Jonathan Ong me@jongleberry.com 71 | 72 | Permission is hereby granted, free of charge, to any person obtaining a copy 73 | of this software and associated documentation files (the "Software"), to deal 74 | in the Software without restriction, including without limitation the rights 75 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 76 | copies of the Software, and to permit persons to whom the Software is 77 | furnished to do so, subject to the following conditions: 78 | 79 | The above copyright notice and this permission notice shall be included in 80 | all copies or substantial portions of the Software. 81 | 82 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 83 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 84 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 85 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 86 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 87 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 88 | THE SOFTWARE. 89 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/node_modules/mime/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Benjamin Thomas, Robert Kieffer 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/node_modules/mime/README.md: -------------------------------------------------------------------------------- 1 | # mime 2 | 3 | Comprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community. 4 | 5 | ## Install 6 | 7 | Install with [npm](http://github.com/isaacs/npm): 8 | 9 | npm install mime 10 | 11 | ## API - Queries 12 | 13 | ### mime.lookup(path) 14 | Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g. 15 | 16 | var mime = require('mime'); 17 | 18 | mime.lookup('/path/to/file.txt'); // => 'text/plain' 19 | mime.lookup('file.txt'); // => 'text/plain' 20 | mime.lookup('.TXT'); // => 'text/plain' 21 | mime.lookup('htm'); // => 'text/html' 22 | 23 | ### mime.default_type 24 | Sets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.) 25 | 26 | ### mime.extension(type) 27 | Get the default extension for `type` 28 | 29 | mime.extension('text/html'); // => 'html' 30 | mime.extension('application/octet-stream'); // => 'bin' 31 | 32 | ### mime.charsets.lookup() 33 | 34 | Map mime-type to charset 35 | 36 | mime.charsets.lookup('text/plain'); // => 'UTF-8' 37 | 38 | (The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) 39 | 40 | ## API - Defining Custom Types 41 | 42 | The following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types). 43 | 44 | ### mime.define() 45 | 46 | Add custom mime/extension mappings 47 | 48 | mime.define({ 49 | 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], 50 | 'application/x-my-type': ['x-mt', 'x-mtt'], 51 | // etc ... 52 | }); 53 | 54 | mime.lookup('x-sft'); // => 'text/x-some-format' 55 | 56 | The first entry in the extensions array is returned by `mime.extension()`. E.g. 57 | 58 | mime.extension('text/x-some-format'); // => 'x-sf' 59 | 60 | ### mime.load(filepath) 61 | 62 | Load mappings from an Apache ".types" format file 63 | 64 | mime.load('./my_project.types'); 65 | 66 | The .types file format is simple - See the `types` dir for examples. 67 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/node_modules/mime/mime.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var fs = require('fs'); 3 | 4 | function Mime() { 5 | // Map of extension -> mime type 6 | this.types = Object.create(null); 7 | 8 | // Map of mime type -> extension 9 | this.extensions = Object.create(null); 10 | } 11 | 12 | /** 13 | * Define mimetype -> extension mappings. Each key is a mime-type that maps 14 | * to an array of extensions associated with the type. The first extension is 15 | * used as the default extension for the type. 16 | * 17 | * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); 18 | * 19 | * @param map (Object) type definitions 20 | */ 21 | Mime.prototype.define = function (map) { 22 | for (var type in map) { 23 | var exts = map[type]; 24 | 25 | for (var i = 0; i < exts.length; i++) { 26 | if (process.env.DEBUG_MIME && this.types[exts]) { 27 | console.warn(this._loading.replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + 28 | this.types[exts] + ' to ' + type); 29 | } 30 | 31 | this.types[exts[i]] = type; 32 | } 33 | 34 | // Default extension is the first one we encounter 35 | if (!this.extensions[type]) { 36 | this.extensions[type] = exts[0]; 37 | } 38 | } 39 | }; 40 | 41 | /** 42 | * Load an Apache2-style ".types" file 43 | * 44 | * This may be called multiple times (it's expected). Where files declare 45 | * overlapping types/extensions, the last file wins. 46 | * 47 | * @param file (String) path of file to load. 48 | */ 49 | Mime.prototype.load = function(file) { 50 | 51 | this._loading = file; 52 | // Read file and split into lines 53 | var map = {}, 54 | content = fs.readFileSync(file, 'ascii'), 55 | lines = content.split(/[\r\n]+/); 56 | 57 | lines.forEach(function(line) { 58 | // Clean up whitespace/comments, and split into fields 59 | var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); 60 | map[fields.shift()] = fields; 61 | }); 62 | 63 | this.define(map); 64 | 65 | this._loading = null; 66 | }; 67 | 68 | /** 69 | * Lookup a mime type based on extension 70 | */ 71 | Mime.prototype.lookup = function(path, fallback) { 72 | var ext = path.replace(/.*[\.\/\\]/, '').toLowerCase(); 73 | 74 | return this.types[ext] || fallback || this.default_type; 75 | }; 76 | 77 | /** 78 | * Return file extension associated with a mime type 79 | */ 80 | Mime.prototype.extension = function(mimeType) { 81 | var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); 82 | return this.extensions[type]; 83 | }; 84 | 85 | // Default instance 86 | var mime = new Mime(); 87 | 88 | // Load local copy of 89 | // http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types 90 | mime.load(path.join(__dirname, 'types/mime.types')); 91 | 92 | // Load additional types from node.js community 93 | mime.load(path.join(__dirname, 'types/node.types')); 94 | 95 | // Default type 96 | mime.default_type = mime.lookup('bin'); 97 | 98 | // 99 | // Additional API specific to the default instance 100 | // 101 | 102 | mime.Mime = Mime; 103 | 104 | /** 105 | * Lookup a charset based on mime type. 106 | */ 107 | mime.charsets = { 108 | lookup: function(mimeType, fallback) { 109 | // Assume text types are utf8 110 | return (/^text\//).test(mimeType) ? 'UTF-8' : fallback; 111 | } 112 | }; 113 | 114 | module.exports = mime; 115 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/node_modules/mime/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Robert Kieffer", 4 | "email": "robert@broofa.com", 5 | "url": "http://github.com/broofa" 6 | }, 7 | "contributors": [ 8 | { 9 | "name": "Benjamin Thomas", 10 | "email": "benjamin@benjaminthomas.org", 11 | "url": "http://github.com/bentomas" 12 | } 13 | ], 14 | "dependencies": {}, 15 | "description": "A comprehensive library for mime-type mapping", 16 | "devDependencies": {}, 17 | "keywords": [ 18 | "util", 19 | "mime" 20 | ], 21 | "main": "mime.js", 22 | "name": "mime", 23 | "repository": { 24 | "url": "https://github.com/broofa/node-mime", 25 | "type": "git" 26 | }, 27 | "version": "1.2.11", 28 | "readme": "# mime\n\nComprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n npm install mime\n\n## API - Queries\n\n### mime.lookup(path)\nGet the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g.\n\n var mime = require('mime');\n\n mime.lookup('/path/to/file.txt'); // => 'text/plain'\n mime.lookup('file.txt'); // => 'text/plain'\n mime.lookup('.TXT'); // => 'text/plain'\n mime.lookup('htm'); // => 'text/html'\n\n### mime.default_type\nSets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)\n\n### mime.extension(type)\nGet the default extension for `type`\n\n mime.extension('text/html'); // => 'html'\n mime.extension('application/octet-stream'); // => 'bin'\n\n### mime.charsets.lookup()\n\nMap mime-type to charset\n\n mime.charsets.lookup('text/plain'); // => 'UTF-8'\n\n(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.)\n\n## API - Defining Custom Types\n\nThe following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types).\n\n### mime.define()\n\nAdd custom mime/extension mappings\n\n mime.define({\n 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n 'application/x-my-type': ['x-mt', 'x-mtt'],\n // etc ...\n });\n\n mime.lookup('x-sft'); // => 'text/x-some-format'\n\nThe first entry in the extensions array is returned by `mime.extension()`. E.g.\n\n mime.extension('text/x-some-format'); // => 'x-sf'\n\n### mime.load(filepath)\n\nLoad mappings from an Apache \".types\" format file\n\n mime.load('./my_project.types');\n\nThe .types file format is simple - See the `types` dir for examples.\n", 29 | "readmeFilename": "README.md", 30 | "bugs": { 31 | "url": "https://github.com/broofa/node-mime/issues" 32 | }, 33 | "homepage": "https://github.com/broofa/node-mime", 34 | "_id": "mime@1.2.11", 35 | "_from": "mime@1.2.11" 36 | } 37 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/node_modules/mime/test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Usage: node test.js 3 | */ 4 | 5 | var mime = require('./mime'); 6 | var assert = require('assert'); 7 | var path = require('path'); 8 | 9 | function eq(a, b) { 10 | console.log('Test: ' + a + ' === ' + b); 11 | assert.strictEqual.apply(null, arguments); 12 | } 13 | 14 | console.log(Object.keys(mime.extensions).length + ' types'); 15 | console.log(Object.keys(mime.types).length + ' extensions\n'); 16 | 17 | // 18 | // Test mime lookups 19 | // 20 | 21 | eq('text/plain', mime.lookup('text.txt')); // normal file 22 | eq('text/plain', mime.lookup('TEXT.TXT')); // uppercase 23 | eq('text/plain', mime.lookup('dir/text.txt')); // dir + file 24 | eq('text/plain', mime.lookup('.text.txt')); // hidden file 25 | eq('text/plain', mime.lookup('.txt')); // nameless 26 | eq('text/plain', mime.lookup('txt')); // extension-only 27 | eq('text/plain', mime.lookup('/txt')); // extension-less () 28 | eq('text/plain', mime.lookup('\\txt')); // Windows, extension-less 29 | eq('application/octet-stream', mime.lookup('text.nope')); // unrecognized 30 | eq('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default 31 | 32 | // 33 | // Test extensions 34 | // 35 | 36 | eq('txt', mime.extension(mime.types.text)); 37 | eq('html', mime.extension(mime.types.htm)); 38 | eq('bin', mime.extension('application/octet-stream')); 39 | eq('bin', mime.extension('application/octet-stream ')); 40 | eq('html', mime.extension(' text/html; charset=UTF-8')); 41 | eq('html', mime.extension('text/html; charset=UTF-8 ')); 42 | eq('html', mime.extension('text/html; charset=UTF-8')); 43 | eq('html', mime.extension('text/html ; charset=UTF-8')); 44 | eq('html', mime.extension('text/html;charset=UTF-8')); 45 | eq('html', mime.extension('text/Html;charset=UTF-8')); 46 | eq(undefined, mime.extension('unrecognized')); 47 | 48 | // 49 | // Test node.types lookups 50 | // 51 | 52 | eq('application/font-woff', mime.lookup('file.woff')); 53 | eq('application/octet-stream', mime.lookup('file.buffer')); 54 | eq('audio/mp4', mime.lookup('file.m4a')); 55 | eq('font/opentype', mime.lookup('file.otf')); 56 | 57 | // 58 | // Test charsets 59 | // 60 | 61 | eq('UTF-8', mime.charsets.lookup('text/plain')); 62 | eq(undefined, mime.charsets.lookup(mime.types.js)); 63 | eq('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); 64 | 65 | // 66 | // Test for overlaps between mime.types and node.types 67 | // 68 | 69 | var apacheTypes = new mime.Mime(), nodeTypes = new mime.Mime(); 70 | apacheTypes.load(path.join(__dirname, 'types/mime.types')); 71 | nodeTypes.load(path.join(__dirname, 'types/node.types')); 72 | 73 | var keys = [].concat(Object.keys(apacheTypes.types)) 74 | .concat(Object.keys(nodeTypes.types)); 75 | keys.sort(); 76 | for (var i = 1; i < keys.length; i++) { 77 | if (keys[i] == keys[i-1]) { 78 | console.warn('Warning: ' + 79 | 'node.types defines ' + keys[i] + '->' + nodeTypes.types[keys[i]] + 80 | ', mime.types defines ' + keys[i] + '->' + apacheTypes.types[keys[i]]); 81 | } 82 | } 83 | 84 | console.log('\nOK'); 85 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/node_modules/mime/types/node.types: -------------------------------------------------------------------------------- 1 | # What: WebVTT 2 | # Why: To allow formats intended for marking up external text track resources. 3 | # http://dev.w3.org/html5/webvtt/ 4 | # Added by: niftylettuce 5 | text/vtt vtt 6 | 7 | # What: Google Chrome Extension 8 | # Why: To allow apps to (work) be served with the right content type header. 9 | # http://codereview.chromium.org/2830017 10 | # Added by: niftylettuce 11 | application/x-chrome-extension crx 12 | 13 | # What: HTC support 14 | # Why: To properly render .htc files such as CSS3PIE 15 | # Added by: niftylettuce 16 | text/x-component htc 17 | 18 | # What: HTML5 application cache manifes ('.manifest' extension) 19 | # Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps 20 | # per https://developer.mozilla.org/en/offline_resources_in_firefox 21 | # Added by: louisremi 22 | text/cache-manifest manifest 23 | 24 | # What: node binary buffer format 25 | # Why: semi-standard extension w/in the node community 26 | # Added by: tootallnate 27 | application/octet-stream buffer 28 | 29 | # What: The "protected" MP-4 formats used by iTunes. 30 | # Why: Required for streaming music to browsers (?) 31 | # Added by: broofa 32 | application/mp4 m4p 33 | audio/mp4 m4a 34 | 35 | # What: Video format, Part of RFC1890 36 | # Why: See https://github.com/bentomas/node-mime/pull/6 37 | # Added by: mjrusso 38 | video/MP2T ts 39 | 40 | # What: EventSource mime type 41 | # Why: mime type of Server-Sent Events stream 42 | # http://www.w3.org/TR/eventsource/#text-event-stream 43 | # Added by: francois2metz 44 | text/event-stream event-stream 45 | 46 | # What: Mozilla App manifest mime type 47 | # Why: https://developer.mozilla.org/en/Apps/Manifest#Serving_manifests 48 | # Added by: ednapiranha 49 | application/x-web-app-manifest+json webapp 50 | 51 | # What: Lua file types 52 | # Why: Googling around shows de-facto consensus on these 53 | # Added by: creationix (Issue #45) 54 | text/x-lua lua 55 | application/x-lua-bytecode luac 56 | 57 | # What: Markdown files, as per http://daringfireball.net/projects/markdown/syntax 58 | # Why: http://stackoverflow.com/questions/10701983/what-is-the-mime-type-for-markdown 59 | # Added by: avoidwork 60 | text/x-markdown markdown md mkd 61 | 62 | # What: ini files 63 | # Why: because they're just text files 64 | # Added by: Matthew Kastor 65 | text/plain ini 66 | 67 | # What: DASH Adaptive Streaming manifest 68 | # Why: https://developer.mozilla.org/en-US/docs/DASH_Adaptive_Streaming_for_HTML_5_Video 69 | # Added by: eelcocramer 70 | application/dash+xml mdp 71 | 72 | # What: OpenType font files - http://www.microsoft.com/typography/otspec/ 73 | # Why: Browsers usually ignore the font MIME types and sniff the content, 74 | # but Chrome, shows a warning if OpenType fonts aren't served with 75 | # the `font/opentype` MIME type: http://i.imgur.com/8c5RN8M.png. 76 | # Added by: alrra 77 | font/opentype otf 78 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "type-is", 3 | "description": "Infer the content type if a request", 4 | "version": "1.2.0", 5 | "author": { 6 | "name": "Jonathan Ong", 7 | "email": "me@jongleberry.com", 8 | "url": "http://jongleberry.com" 9 | }, 10 | "contributors": [ 11 | { 12 | "name": "Douglas Christopher Wilson", 13 | "email": "doug@somethingdoug.com" 14 | } 15 | ], 16 | "license": "MIT", 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/expressjs/type-is" 20 | }, 21 | "dependencies": { 22 | "mime": "1.2.11" 23 | }, 24 | "devDependencies": { 25 | "mocha": "*", 26 | "should": "*" 27 | }, 28 | "engines": { 29 | "node": ">= 0.8" 30 | }, 31 | "scripts": { 32 | "test": "mocha --require should --reporter spec --bail" 33 | }, 34 | "readme": "# type-is [![Build Status](https://travis-ci.org/expressjs/type-is.svg?branch=master)](https://travis-ci.org/expressjs/type-is) [![NPM version](https://badge.fury.io/js/type-is.svg)](https://badge.fury.io/js/type-is)\n\nInfer the content type of a request. \nExtracted from [koa](https://github.com/koajs/koa) for general use.\n\nHere's an example body parser:\n\n```js\nvar is = require('type-is');\nvar parse = require('body');\nvar busboy = require('busboy');\n\nfunction bodyParser(req, res, next) {\n var hasRequestBody = 'content-type' in req.headers\n || 'transfer-encoding' in req.headers;\n if (!hasRequestBody) return next();\n \n switch (is(req, ['urlencoded', 'json', 'multipart'])) {\n case 'urlencoded':\n // parse urlencoded body\n break\n case 'json':\n // parse json body\n break\n case 'multipart':\n // parse multipart body\n break\n default:\n // 415 error code\n }\n}\n```\n\n## API\n\n### var type = is(request, types)\n\n```js\nvar is = require('type-is')\n\nhttp.createServer(function (req, res) {\n is(req, ['text/*'])\n})\n```\n\n`request` is the node HTTP request. `types` is an array of types. Each type can be:\n\n- An extension name such as `json`. This name will be returned if matched.\n- A mime type such as `application/json`.\n- A mime type with a wildcard such as `*/json` or `application/*`. The full mime type will be returned if matched\n- A suffix such as `+json`. This can be combined with a wildcard such as `*/vnd+json` or `application/*+json`. The full mime type will be returned if matched.\n\n`false` will be returned if no type matches.\n\nExamples:\n\n```js\n// req.headers.content-type = 'application/json'\nis(req, ['json']) // -> 'json'\nis(req, ['html', 'json']) // -> 'json'\nis(req, ['application/*']) // -> 'application/json'\nis(req, ['application/json']) // -> 'application/json'\nis(req, ['html']) // -> false\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Jonathan Ong me@jongleberry.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", 35 | "readmeFilename": "README.md", 36 | "bugs": { 37 | "url": "https://github.com/expressjs/type-is/issues" 38 | }, 39 | "homepage": "https://github.com/expressjs/type-is", 40 | "_id": "type-is@1.2.0", 41 | "_from": "type-is@1.2.0" 42 | } 43 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/.npmignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | 46 | [Dd]ebug/ 47 | [Rr]elease/ 48 | x64/ 49 | build/ 50 | [Bb]in/ 51 | [Oo]bj/ 52 | 53 | # MSTest test Results 54 | [Tt]est[Rr]esult*/ 55 | [Bb]uild[Ll]og.* 56 | 57 | *_i.c 58 | *_p.c 59 | *.ilk 60 | *.meta 61 | *.obj 62 | *.pch 63 | *.pdb 64 | *.pgc 65 | *.pgd 66 | *.rsp 67 | *.sbr 68 | *.tlb 69 | *.tli 70 | *.tlh 71 | *.tmp 72 | *.tmp_proj 73 | *.log 74 | *.vspscc 75 | *.vssscc 76 | .builds 77 | *.pidb 78 | *.log 79 | *.scc 80 | 81 | # Visual C++ cache files 82 | ipch/ 83 | *.aps 84 | *.ncb 85 | *.opensdf 86 | *.sdf 87 | *.cachefile 88 | 89 | # Visual Studio profiler 90 | *.psess 91 | *.vsp 92 | *.vspx 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | 101 | # TeamCity is a build add-in 102 | _TeamCity* 103 | 104 | # DotCover is a Code Coverage Tool 105 | *.dotCover 106 | 107 | # NCrunch 108 | *.ncrunch* 109 | .*crunch*.local.xml 110 | 111 | # Installshield output folder 112 | [Ee]xpress/ 113 | 114 | # DocProject is a documentation generator add-in 115 | DocProject/buildhelp/ 116 | DocProject/Help/*.HxT 117 | DocProject/Help/*.HxC 118 | DocProject/Help/*.hhc 119 | DocProject/Help/*.hhk 120 | DocProject/Help/*.hhp 121 | DocProject/Help/Html2 122 | DocProject/Help/html 123 | 124 | # Click-Once directory 125 | publish/ 126 | 127 | # Publish Web Output 128 | *.Publish.xml 129 | *.pubxml 130 | 131 | # NuGet Packages Directory 132 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 133 | #packages/ 134 | 135 | # Windows Azure Build Output 136 | csx 137 | *.build.csdef 138 | 139 | # Windows Store app package directory 140 | AppPackages/ 141 | 142 | # Others 143 | sql/ 144 | *.Cache 145 | ClientBin/ 146 | [Ss]tyle[Cc]op.* 147 | ~$* 148 | *~ 149 | *.dbmdl 150 | *.[Pp]ublish.xml 151 | *.pfx 152 | *.publishsettings 153 | 154 | # RIA/Silverlight projects 155 | Generated_Code/ 156 | 157 | # Backup & report files from converting an old project file to a newer 158 | # Visual Studio version. Backup files are not needed, because we have git ;-) 159 | _UpgradeReport_Files/ 160 | Backup*/ 161 | UpgradeLog*.XML 162 | UpgradeLog*.htm 163 | 164 | # SQL Server files 165 | App_Data/*.mdf 166 | App_Data/*.ldf 167 | 168 | ############# 169 | ## Windows detritus 170 | ############# 171 | 172 | # Windows image file caches 173 | Thumbs.db 174 | ehthumbs.db 175 | 176 | # Folder config file 177 | Desktop.ini 178 | 179 | # Recycle Bin used on file shares 180 | $RECYCLE.BIN/ 181 | 182 | # Mac crap 183 | .DS_Store 184 | 185 | 186 | ############# 187 | ## Python 188 | ############# 189 | 190 | *.py[co] 191 | 192 | # Packages 193 | *.egg 194 | *.egg-info 195 | dist/ 196 | build/ 197 | eggs/ 198 | parts/ 199 | var/ 200 | sdist/ 201 | develop-eggs/ 202 | .installed.cfg 203 | 204 | # Installer logs 205 | pip-log.txt 206 | 207 | # Unit test / coverage reports 208 | .coverage 209 | .tox 210 | 211 | #Translations 212 | *.mo 213 | 214 | #Mr Developer 215 | .mr.developer.cfg 216 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | - "0.11" 5 | matrix: 6 | allow_failures: 7 | - node_js: "0.11" 8 | fast_finish: true 9 | script: "npm run-script test-travis" -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/DemoPicture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptnull/compilex/afb74a011b9297087c5446720271bef837325784/examples/compilex-Demo1/node_modules/compilex/DemoPicture.png -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/License.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright (c) 2014 Vishnu Bharathi 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/TestSnippets.txt: -------------------------------------------------------------------------------- 1 | C 2 | == 3 | 4 | #include 5 | int main() 6 | { 7 | printf("Hello World from C"); 8 | return 0; 9 | } 10 | 11 | #include 12 | int main() 13 | { 14 | int a , b, c ; 15 | scanf("%d",&a); 16 | scanf("%d",&b); 17 | c = a + b ; 18 | printf("%d",c); 19 | return 0; 20 | } 21 | 22 | @@@@@@@@@@@@@@@@@@@@@@@@ 23 | 24 | C++ 25 | === 26 | #include 27 | using namespace std; 28 | int main() 29 | { 30 | cout<<"Hello World from C++"; 31 | return 0; 32 | } 33 | 34 | #include 35 | using namespace std; 36 | int main() 37 | { 38 | int a , b, c ; 39 | cin>>a; 40 | cin>>b; 41 | c = a + b ; 42 | cout< 3 | 4 | Compilex 5 | 6 | 7 |
8 |

Compilex Demo

9 |
10 |

Code

11 | 12 |
13 |

Input

14 | 15 |
16 | Language : 22 | Compile With Input : 23 | yes 24 | No 25 |
26 | 27 |
28 |
29 | 30 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/.npmignore: -------------------------------------------------------------------------------- 1 | test/ 2 | .travis.yml 3 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.2.1 / 2014-05-26 2 | ================== 3 | 4 | * invoke `next(err)` after request fully read 5 | - prevents hung responses and socket hang ups 6 | 7 | 1.2.0 / 2014-05-11 8 | ================== 9 | 10 | * add `verify` option 11 | * deps: type-is@1.2.0 12 | - support suffix matching 13 | 14 | 1.1.2 / 2014-05-11 15 | ================== 16 | 17 | * improve json parser speed 18 | 19 | 1.1.1 / 2014-05-11 20 | ================== 21 | 22 | * fix repeated limit parsing with every request 23 | 24 | 1.1.0 / 2014-05-10 25 | ================== 26 | 27 | * add `type` option 28 | * deps: pin for safety and consistency 29 | 30 | 1.0.2 / 2014-04-14 31 | ================== 32 | 33 | * use `type-is` module 34 | 35 | 1.0.1 / 2014-03-20 36 | ================== 37 | 38 | * lower default limits to 100kb 39 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/bytes/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/bytes/History.md: -------------------------------------------------------------------------------- 1 | 2 | 1.0.0 / 2014-05-05 3 | ================== 4 | 5 | * add negative support. fixes #6 6 | 7 | 0.3.0 / 2014-03-19 8 | ================== 9 | 10 | * added terabyte support 11 | 12 | 0.2.1 / 2013-04-01 13 | ================== 14 | 15 | * add .component 16 | 17 | 0.2.0 / 2012-10-28 18 | ================== 19 | 20 | * bytes(200).should.eql('200b') 21 | 22 | 0.1.0 / 2012-07-04 23 | ================== 24 | 25 | * add bytes to string conversion [yields] 26 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/bytes/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha \ 4 | --reporter spec \ 5 | --require should 6 | 7 | .PHONY: test -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/bytes/Readme.md: -------------------------------------------------------------------------------- 1 | # node-bytes 2 | 3 | Byte string parser / formatter. 4 | 5 | ## Example: 6 | 7 | ```js 8 | bytes('1kb') 9 | // => 1024 10 | 11 | bytes('2mb') 12 | // => 2097152 13 | 14 | bytes('1gb') 15 | // => 1073741824 16 | 17 | bytes(1073741824) 18 | // => 1gb 19 | 20 | bytes(1099511627776) 21 | // => 1tb 22 | ``` 23 | 24 | ## Installation 25 | 26 | ``` 27 | $ npm install bytes 28 | $ component install visionmedia/bytes.js 29 | ``` 30 | 31 | ## License 32 | 33 | (The MIT License) 34 | 35 | Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca> 36 | 37 | Permission is hereby granted, free of charge, to any person obtaining 38 | a copy of this software and associated documentation files (the 39 | 'Software'), to deal in the Software without restriction, including 40 | without limitation the rights to use, copy, modify, merge, publish, 41 | distribute, sublicense, and/or sell copies of the Software, and to 42 | permit persons to whom the Software is furnished to do so, subject to 43 | the following conditions: 44 | 45 | The above copyright notice and this permission notice shall be 46 | included in all copies or substantial portions of the Software. 47 | 48 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 49 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 50 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 51 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 52 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 53 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 54 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 55 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/bytes/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bytes", 3 | "description": "byte size string parser / serializer", 4 | "keywords": ["bytes", "utility"], 5 | "version": "0.2.1", 6 | "scripts": ["index.js"] 7 | } 8 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/bytes/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Parse byte `size` string. 4 | * 5 | * @param {String} size 6 | * @return {Number} 7 | * @api public 8 | */ 9 | 10 | module.exports = function(size) { 11 | if ('number' == typeof size) return convert(size); 12 | var parts = size.match(/^(\d+(?:\.\d+)?) *(kb|mb|gb|tb)$/) 13 | , n = parseFloat(parts[1]) 14 | , type = parts[2]; 15 | 16 | var map = { 17 | kb: 1 << 10 18 | , mb: 1 << 20 19 | , gb: 1 << 30 20 | , tb: ((1 << 30) * 1024) 21 | }; 22 | 23 | return map[type] * n; 24 | }; 25 | 26 | /** 27 | * convert bytes into string. 28 | * 29 | * @param {Number} b - bytes to convert 30 | * @return {String} 31 | * @api public 32 | */ 33 | 34 | function convert (b) { 35 | var tb = ((1 << 30) * 1024), gb = 1 << 30, mb = 1 << 20, kb = 1 << 10, abs = Math.abs(b); 36 | if (abs >= tb) return (Math.round(b / tb * 100) / 100) + 'tb'; 37 | if (abs >= gb) return (Math.round(b / gb * 100) / 100) + 'gb'; 38 | if (abs >= mb) return (Math.round(b / mb * 100) / 100) + 'mb'; 39 | if (abs >= kb) return (Math.round(b / kb * 100) / 100) + 'kb'; 40 | return b + 'b'; 41 | } 42 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/bytes/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bytes", 3 | "author": { 4 | "name": "TJ Holowaychuk", 5 | "email": "tj@vision-media.ca", 6 | "url": "http://tjholowaychuk.com" 7 | }, 8 | "description": "byte size string parser / serializer", 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/visionmedia/bytes.js.git" 12 | }, 13 | "version": "1.0.0", 14 | "main": "index.js", 15 | "dependencies": {}, 16 | "devDependencies": { 17 | "mocha": "*", 18 | "should": "*" 19 | }, 20 | "component": { 21 | "scripts": { 22 | "bytes/index.js": "index.js" 23 | } 24 | }, 25 | "readme": "# node-bytes\n\n Byte string parser / formatter.\n\n## Example:\n\n```js\nbytes('1kb')\n// => 1024\n\nbytes('2mb')\n// => 2097152\n\nbytes('1gb')\n// => 1073741824\n\nbytes(1073741824)\n// => 1gb\n\nbytes(1099511627776)\n// => 1tb\n```\n\n## Installation\n\n```\n$ npm install bytes\n$ component install visionmedia/bytes.js\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", 26 | "readmeFilename": "Readme.md", 27 | "bugs": { 28 | "url": "https://github.com/visionmedia/bytes.js/issues" 29 | }, 30 | "homepage": "https://github.com/visionmedia/bytes.js", 31 | "_id": "bytes@1.0.0", 32 | "_from": "bytes@1.0.0" 33 | } 34 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/qs/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "support/expresso"] 2 | path = support/expresso 3 | url = git://github.com/visionmedia/expresso.git 4 | [submodule "support/should"] 5 | path = support/should 6 | url = git://github.com/visionmedia/should.js.git 7 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/qs/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | .travis.yml 3 | benchmark.js 4 | component.json 5 | examples.js 6 | History.md 7 | Makefile 8 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/qs/Readme.md: -------------------------------------------------------------------------------- 1 | # node-querystring 2 | 3 | query string parser for node and the browser supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others. 4 | 5 | ## Installation 6 | 7 | $ npm install qs 8 | 9 | ## Examples 10 | 11 | ```js 12 | var qs = require('qs'); 13 | 14 | qs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com'); 15 | // => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } } 16 | 17 | qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }}) 18 | // => user[name]=Tobi&user[email]=tobi%40learnboost.com 19 | ``` 20 | 21 | ## Testing 22 | 23 | Install dev dependencies: 24 | 25 | $ npm install -d 26 | 27 | and execute: 28 | 29 | $ make test 30 | 31 | browser: 32 | 33 | $ open test/browser/index.html 34 | 35 | ## License 36 | 37 | (The MIT License) 38 | 39 | Copyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca> 40 | 41 | Permission is hereby granted, free of charge, to any person obtaining 42 | a copy of this software and associated documentation files (the 43 | 'Software'), to deal in the Software without restriction, including 44 | without limitation the rights to use, copy, modify, merge, publish, 45 | distribute, sublicense, and/or sell copies of the Software, and to 46 | permit persons to whom the Software is furnished to do so, subject to 47 | the following conditions: 48 | 49 | The above copyright notice and this permission notice shall be 50 | included in all copies or substantial portions of the Software. 51 | 52 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 53 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 54 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 55 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 56 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 57 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 58 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/qs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "qs", 3 | "description": "querystring parser", 4 | "version": "0.6.6", 5 | "keywords": [ 6 | "query string", 7 | "parser", 8 | "component" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "git://github.com/visionmedia/node-querystring.git" 13 | }, 14 | "devDependencies": { 15 | "mocha": "*", 16 | "expect.js": "*" 17 | }, 18 | "scripts": { 19 | "test": "make test" 20 | }, 21 | "author": { 22 | "name": "TJ Holowaychuk", 23 | "email": "tj@vision-media.ca", 24 | "url": "http://tjholowaychuk.com" 25 | }, 26 | "main": "index", 27 | "engines": { 28 | "node": "*" 29 | }, 30 | "readme": "# node-querystring\n\n query string parser for node and the browser supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others.\n\n## Installation\n\n $ npm install qs\n\n## Examples\n\n```js\nvar qs = require('qs');\n\nqs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com');\n// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } }\n\nqs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }})\n// => user[name]=Tobi&user[email]=tobi%40learnboost.com\n```\n\n## Testing\n\nInstall dev dependencies:\n\n $ npm install -d\n\nand execute:\n\n $ make test\n\nbrowser:\n\n $ open test/browser/index.html\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", 31 | "readmeFilename": "Readme.md", 32 | "bugs": { 33 | "url": "https://github.com/visionmedia/node-querystring/issues" 34 | }, 35 | "homepage": "https://github.com/visionmedia/node-querystring", 36 | "_id": "qs@0.6.6", 37 | "_from": "qs@0.6.6" 38 | } 39 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/.npmignore: -------------------------------------------------------------------------------- 1 | test/ -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/.travis.yml: -------------------------------------------------------------------------------- 1 | node_js: 2 | - "0.8" 3 | - "0.10" 4 | - "0.11" 5 | language: node_js -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/Makefile: -------------------------------------------------------------------------------- 1 | NODE ?= node 2 | BIN = ./node_modules/.bin/ 3 | 4 | test: 5 | @${NODE} ${BIN}mocha \ 6 | --harmony-generators \ 7 | --reporter spec \ 8 | --bail \ 9 | ./test/index.js 10 | 11 | clean: 12 | @rm -rf node_modules 13 | 14 | .PHONY: test clean 15 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/README.md: -------------------------------------------------------------------------------- 1 | # Raw Body [![Build Status](https://travis-ci.org/stream-utils/raw-body.svg?branch=master)](https://travis-ci.org/stream-utils/raw-body) 2 | 3 | Gets the entire buffer of a stream either as a `Buffer` or a string. 4 | Validates the stream's length against an expected length and maximum limit. 5 | Ideal for parsing request bodies. 6 | 7 | ## API 8 | 9 | ```js 10 | var getRawBody = require('raw-body') 11 | 12 | app.use(function (req, res, next) { 13 | getRawBody(req, { 14 | length: req.headers['content-length'], 15 | limit: '1mb', 16 | encoding: 'utf8' 17 | }, function (err, string) { 18 | if (err) 19 | return next(err) 20 | 21 | req.text = string 22 | next() 23 | }) 24 | }) 25 | ``` 26 | 27 | or in a Koa generator: 28 | 29 | ```js 30 | app.use(function* (next) { 31 | var string = yield getRawBody(this.req, { 32 | length: this.length, 33 | limit: '1mb', 34 | encoding: 'utf8' 35 | }) 36 | }) 37 | ``` 38 | 39 | ### getRawBody(stream, [options], [callback]) 40 | 41 | Returns a thunk for yielding with generators. 42 | 43 | Options: 44 | 45 | - `length` - The length length of the stream. 46 | If the contents of the stream do not add up to this length, 47 | an `400` error code is returned. 48 | - `limit` - The byte limit of the body. 49 | If the body ends up being larger than this limit, 50 | a `413` error code is returned. 51 | - `encoding` - The requested encoding. 52 | By default, a `Buffer` instance will be returned. 53 | Most likely, you want `utf8`. 54 | You can use any type of encoding supported by [StringDecoder](http://nodejs.org/api/string_decoder.html). 55 | You can also pass `true` which sets it to the default `utf8` 56 | 57 | `callback(err, res)`: 58 | 59 | - `err` - the following attributes will be defined if applicable: 60 | 61 | - `limit` - the limit in bytes 62 | - `length` and `expected` - the expected length of the stream 63 | - `received` - the received bytes 64 | - `status` and `statusCode` - the corresponding status code for the error 65 | - `type` - either `entity.too.large`, `request.size.invalid`, or `stream.encoding.set` 66 | 67 | - `res` - the result, either as a `String` if an encoding was set or a `Buffer` otherwise. 68 | 69 | If an error occurs, the stream will be paused, 70 | and you are responsible for correctly disposing the stream. 71 | For HTTP requests, no handling is required if you send a response. 72 | For streams that use file descriptors, you should `stream.destroy()` or `stream.close()` to prevent leaks. 73 | 74 | ## License 75 | 76 | The MIT License (MIT) 77 | 78 | Copyright (c) 2013 Jonathan Ong me@jongleberry.com 79 | 80 | Permission is hereby granted, free of charge, to any person obtaining a copy 81 | of this software and associated documentation files (the "Software"), to deal 82 | in the Software without restriction, including without limitation the rights 83 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 84 | copies of the Software, and to permit persons to whom the Software is 85 | furnished to do so, subject to the following conditions: 86 | 87 | The above copyright notice and this permission notice shall be included in 88 | all copies or substantial portions of the Software. 89 | 90 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 91 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 92 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 93 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 94 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 95 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 96 | THE SOFTWARE. 97 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/node_modules/bytes/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/node_modules/bytes/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.3.0 / 2014-03-19 3 | ================== 4 | 5 | * added terabyte support 6 | 7 | 0.2.1 / 2013-04-01 8 | ================== 9 | 10 | * add .component 11 | 12 | 0.2.0 / 2012-10-28 13 | ================== 14 | 15 | * bytes(200).should.eql('200b') 16 | 17 | 0.1.0 / 2012-07-04 18 | ================== 19 | 20 | * add bytes to string conversion [yields] 21 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/node_modules/bytes/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha \ 4 | --reporter spec \ 5 | --require should 6 | 7 | .PHONY: test -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/node_modules/bytes/Readme.md: -------------------------------------------------------------------------------- 1 | # node-bytes 2 | 3 | Byte string parser / formatter. 4 | 5 | ## Example: 6 | 7 | ```js 8 | bytes('1kb') 9 | // => 1024 10 | 11 | bytes('2mb') 12 | // => 2097152 13 | 14 | bytes('1gb') 15 | // => 1073741824 16 | 17 | bytes(1073741824) 18 | // => 1gb 19 | 20 | bytes(1099511627776) 21 | // => 1tb 22 | ``` 23 | 24 | ## Installation 25 | 26 | ``` 27 | $ npm install bytes 28 | $ component install visionmedia/bytes.js 29 | ``` 30 | 31 | ## License 32 | 33 | (The MIT License) 34 | 35 | Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca> 36 | 37 | Permission is hereby granted, free of charge, to any person obtaining 38 | a copy of this software and associated documentation files (the 39 | 'Software'), to deal in the Software without restriction, including 40 | without limitation the rights to use, copy, modify, merge, publish, 41 | distribute, sublicense, and/or sell copies of the Software, and to 42 | permit persons to whom the Software is furnished to do so, subject to 43 | the following conditions: 44 | 45 | The above copyright notice and this permission notice shall be 46 | included in all copies or substantial portions of the Software. 47 | 48 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 49 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 50 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 51 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 52 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 53 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 54 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 55 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/node_modules/bytes/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bytes", 3 | "description": "byte size string parser / serializer", 4 | "keywords": ["bytes", "utility"], 5 | "version": "0.2.1", 6 | "scripts": ["index.js"] 7 | } 8 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/node_modules/bytes/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Parse byte `size` string. 4 | * 5 | * @param {String} size 6 | * @return {Number} 7 | * @api public 8 | */ 9 | 10 | module.exports = function(size) { 11 | if ('number' == typeof size) return convert(size); 12 | var parts = size.match(/^(\d+(?:\.\d+)?) *(kb|mb|gb|tb)$/) 13 | , n = parseFloat(parts[1]) 14 | , type = parts[2]; 15 | 16 | var map = { 17 | kb: 1 << 10 18 | , mb: 1 << 20 19 | , gb: 1 << 30 20 | , tb: ((1 << 30) * 1024) 21 | }; 22 | 23 | return map[type] * n; 24 | }; 25 | 26 | /** 27 | * convert bytes into string. 28 | * 29 | * @param {Number} b - bytes to convert 30 | * @return {String} 31 | * @api public 32 | */ 33 | 34 | function convert (b) { 35 | var tb = ((1 << 30) * 1024), gb = 1 << 30, mb = 1 << 20, kb = 1 << 10; 36 | if (b >= tb) return (Math.round(b / tb * 100) / 100) + 'tb'; 37 | if (b >= gb) return (Math.round(b / gb * 100) / 100) + 'gb'; 38 | if (b >= mb) return (Math.round(b / mb * 100) / 100) + 'mb'; 39 | if (b >= kb) return (Math.round(b / kb * 100) / 100) + 'kb'; 40 | return b + 'b'; 41 | } 42 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/node_modules/bytes/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bytes", 3 | "author": { 4 | "name": "TJ Holowaychuk", 5 | "email": "tj@vision-media.ca", 6 | "url": "http://tjholowaychuk.com" 7 | }, 8 | "description": "byte size string parser / serializer", 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/visionmedia/bytes.js.git" 12 | }, 13 | "version": "0.3.0", 14 | "main": "index.js", 15 | "dependencies": {}, 16 | "devDependencies": { 17 | "mocha": "*", 18 | "should": "*" 19 | }, 20 | "component": { 21 | "scripts": { 22 | "bytes/index.js": "index.js" 23 | } 24 | }, 25 | "readme": "# node-bytes\n\n Byte string parser / formatter.\n\n## Example:\n\n```js\nbytes('1kb')\n// => 1024\n\nbytes('2mb')\n// => 2097152\n\nbytes('1gb')\n// => 1073741824\n\nbytes(1073741824)\n// => 1gb\n\nbytes(1099511627776)\n// => 1tb\n```\n\n## Installation\n\n```\n$ npm install bytes\n$ component install visionmedia/bytes.js\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", 26 | "readmeFilename": "Readme.md", 27 | "bugs": { 28 | "url": "https://github.com/visionmedia/bytes.js/issues" 29 | }, 30 | "homepage": "https://github.com/visionmedia/bytes.js", 31 | "_id": "bytes@0.3.0", 32 | "_from": "bytes@~0.3.0" 33 | } 34 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/raw-body/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "raw-body", 3 | "description": "Get and validate the raw body of a readable stream.", 4 | "version": "1.1.4", 5 | "author": { 6 | "name": "Jonathan Ong", 7 | "email": "me@jongleberry.com", 8 | "url": "http://jongleberry.com" 9 | }, 10 | "license": "MIT", 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/stream-utils/raw-body.git" 14 | }, 15 | "bugs": { 16 | "url": "https://github.com/stream-utils/raw-body/issues" 17 | }, 18 | "dependencies": { 19 | "bytes": "~0.3.0" 20 | }, 21 | "devDependencies": { 22 | "readable-stream": "~1.0.17", 23 | "co": "3", 24 | "gnode": "~0.0.4", 25 | "mocha": "^1.14.0", 26 | "through2": "~0.4.1", 27 | "request": "^2.27.0", 28 | "assert-tap": "~0.1.4" 29 | }, 30 | "scripts": { 31 | "test": "NODE=gnode make test && node ./test/acceptance.js" 32 | }, 33 | "engines": { 34 | "node": ">= 0.8.0" 35 | }, 36 | "readme": "# Raw Body [![Build Status](https://travis-ci.org/stream-utils/raw-body.svg?branch=master)](https://travis-ci.org/stream-utils/raw-body)\n\nGets the entire buffer of a stream either as a `Buffer` or a string.\nValidates the stream's length against an expected length and maximum limit.\nIdeal for parsing request bodies.\n\n## API\n\n```js\nvar getRawBody = require('raw-body')\n\napp.use(function (req, res, next) {\n getRawBody(req, {\n length: req.headers['content-length'],\n limit: '1mb',\n encoding: 'utf8'\n }, function (err, string) {\n if (err)\n return next(err)\n\n req.text = string\n next()\n })\n})\n```\n\nor in a Koa generator:\n\n```js\napp.use(function* (next) {\n var string = yield getRawBody(this.req, {\n length: this.length,\n limit: '1mb',\n encoding: 'utf8'\n })\n})\n```\n\n### getRawBody(stream, [options], [callback])\n\nReturns a thunk for yielding with generators.\n\nOptions:\n\n- `length` - The length length of the stream.\n If the contents of the stream do not add up to this length,\n an `400` error code is returned.\n- `limit` - The byte limit of the body.\n If the body ends up being larger than this limit,\n a `413` error code is returned.\n- `encoding` - The requested encoding.\n By default, a `Buffer` instance will be returned.\n Most likely, you want `utf8`.\n You can use any type of encoding supported by [StringDecoder](http://nodejs.org/api/string_decoder.html).\n You can also pass `true` which sets it to the default `utf8`\n\n`callback(err, res)`:\n\n- `err` - the following attributes will be defined if applicable:\n\n - `limit` - the limit in bytes\n - `length` and `expected` - the expected length of the stream\n - `received` - the received bytes\n - `status` and `statusCode` - the corresponding status code for the error\n - `type` - either `entity.too.large`, `request.size.invalid`, or `stream.encoding.set`\n\n- `res` - the result, either as a `String` if an encoding was set or a `Buffer` otherwise.\n\nIf an error occurs, the stream will be paused,\nand you are responsible for correctly disposing the stream.\nFor HTTP requests, no handling is required if you send a response.\nFor streams that use file descriptors, you should `stream.destroy()` or `stream.close()` to prevent leaks.\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Jonathan Ong me@jongleberry.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", 37 | "readmeFilename": "README.md", 38 | "homepage": "https://github.com/stream-utils/raw-body", 39 | "_id": "raw-body@1.1.4", 40 | "dist": { 41 | "shasum": "5005bcff1db3833b9e60eaad525f496e179bdce1" 42 | }, 43 | "_from": "raw-body@1.1.4", 44 | "_resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.1.4.tgz" 45 | } 46 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/.npmignore: -------------------------------------------------------------------------------- 1 | test.js 2 | .travis.yml 3 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.2.0 / 2014-05-11 2 | ================== 3 | 4 | * support suffix matching: 5 | 6 | - `+json` matches `application/vnd+json` 7 | - `*/vnd+json` matches `application/vnd+json` 8 | - `application/*+json` matches `application/vnd+json` 9 | 10 | 1.1.0 / 2014-04-12 11 | ================== 12 | 13 | * add non-array values support 14 | * expose internal utilities: 15 | 16 | - `.is()` 17 | - `.hasBody()` 18 | - `.normalize()` 19 | - `.match()` 20 | 21 | 1.0.1 / 2014-03-30 22 | ================== 23 | 24 | * add `multipart` as a shorthand 25 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/README.md: -------------------------------------------------------------------------------- 1 | # type-is [![Build Status](https://travis-ci.org/expressjs/type-is.svg?branch=master)](https://travis-ci.org/expressjs/type-is) [![NPM version](https://badge.fury.io/js/type-is.svg)](https://badge.fury.io/js/type-is) 2 | 3 | Infer the content type of a request. 4 | Extracted from [koa](https://github.com/koajs/koa) for general use. 5 | 6 | Here's an example body parser: 7 | 8 | ```js 9 | var is = require('type-is'); 10 | var parse = require('body'); 11 | var busboy = require('busboy'); 12 | 13 | function bodyParser(req, res, next) { 14 | var hasRequestBody = 'content-type' in req.headers 15 | || 'transfer-encoding' in req.headers; 16 | if (!hasRequestBody) return next(); 17 | 18 | switch (is(req, ['urlencoded', 'json', 'multipart'])) { 19 | case 'urlencoded': 20 | // parse urlencoded body 21 | break 22 | case 'json': 23 | // parse json body 24 | break 25 | case 'multipart': 26 | // parse multipart body 27 | break 28 | default: 29 | // 415 error code 30 | } 31 | } 32 | ``` 33 | 34 | ## API 35 | 36 | ### var type = is(request, types) 37 | 38 | ```js 39 | var is = require('type-is') 40 | 41 | http.createServer(function (req, res) { 42 | is(req, ['text/*']) 43 | }) 44 | ``` 45 | 46 | `request` is the node HTTP request. `types` is an array of types. Each type can be: 47 | 48 | - An extension name such as `json`. This name will be returned if matched. 49 | - A mime type such as `application/json`. 50 | - A mime type with a wildcard such as `*/json` or `application/*`. The full mime type will be returned if matched 51 | - A suffix such as `+json`. This can be combined with a wildcard such as `*/vnd+json` or `application/*+json`. The full mime type will be returned if matched. 52 | 53 | `false` will be returned if no type matches. 54 | 55 | Examples: 56 | 57 | ```js 58 | // req.headers.content-type = 'application/json' 59 | is(req, ['json']) // -> 'json' 60 | is(req, ['html', 'json']) // -> 'json' 61 | is(req, ['application/*']) // -> 'application/json' 62 | is(req, ['application/json']) // -> 'application/json' 63 | is(req, ['html']) // -> false 64 | ``` 65 | 66 | ## License 67 | 68 | The MIT License (MIT) 69 | 70 | Copyright (c) 2013 Jonathan Ong me@jongleberry.com 71 | 72 | Permission is hereby granted, free of charge, to any person obtaining a copy 73 | of this software and associated documentation files (the "Software"), to deal 74 | in the Software without restriction, including without limitation the rights 75 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 76 | copies of the Software, and to permit persons to whom the Software is 77 | furnished to do so, subject to the following conditions: 78 | 79 | The above copyright notice and this permission notice shall be included in 80 | all copies or substantial portions of the Software. 81 | 82 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 83 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 84 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 85 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 86 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 87 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 88 | THE SOFTWARE. 89 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/node_modules/mime/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Benjamin Thomas, Robert Kieffer 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/node_modules/mime/README.md: -------------------------------------------------------------------------------- 1 | # mime 2 | 3 | Comprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community. 4 | 5 | ## Install 6 | 7 | Install with [npm](http://github.com/isaacs/npm): 8 | 9 | npm install mime 10 | 11 | ## API - Queries 12 | 13 | ### mime.lookup(path) 14 | Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g. 15 | 16 | var mime = require('mime'); 17 | 18 | mime.lookup('/path/to/file.txt'); // => 'text/plain' 19 | mime.lookup('file.txt'); // => 'text/plain' 20 | mime.lookup('.TXT'); // => 'text/plain' 21 | mime.lookup('htm'); // => 'text/html' 22 | 23 | ### mime.default_type 24 | Sets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.) 25 | 26 | ### mime.extension(type) 27 | Get the default extension for `type` 28 | 29 | mime.extension('text/html'); // => 'html' 30 | mime.extension('application/octet-stream'); // => 'bin' 31 | 32 | ### mime.charsets.lookup() 33 | 34 | Map mime-type to charset 35 | 36 | mime.charsets.lookup('text/plain'); // => 'UTF-8' 37 | 38 | (The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) 39 | 40 | ## API - Defining Custom Types 41 | 42 | The following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types). 43 | 44 | ### mime.define() 45 | 46 | Add custom mime/extension mappings 47 | 48 | mime.define({ 49 | 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], 50 | 'application/x-my-type': ['x-mt', 'x-mtt'], 51 | // etc ... 52 | }); 53 | 54 | mime.lookup('x-sft'); // => 'text/x-some-format' 55 | 56 | The first entry in the extensions array is returned by `mime.extension()`. E.g. 57 | 58 | mime.extension('text/x-some-format'); // => 'x-sf' 59 | 60 | ### mime.load(filepath) 61 | 62 | Load mappings from an Apache ".types" format file 63 | 64 | mime.load('./my_project.types'); 65 | 66 | The .types file format is simple - See the `types` dir for examples. 67 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/node_modules/mime/mime.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var fs = require('fs'); 3 | 4 | function Mime() { 5 | // Map of extension -> mime type 6 | this.types = Object.create(null); 7 | 8 | // Map of mime type -> extension 9 | this.extensions = Object.create(null); 10 | } 11 | 12 | /** 13 | * Define mimetype -> extension mappings. Each key is a mime-type that maps 14 | * to an array of extensions associated with the type. The first extension is 15 | * used as the default extension for the type. 16 | * 17 | * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); 18 | * 19 | * @param map (Object) type definitions 20 | */ 21 | Mime.prototype.define = function (map) { 22 | for (var type in map) { 23 | var exts = map[type]; 24 | 25 | for (var i = 0; i < exts.length; i++) { 26 | if (process.env.DEBUG_MIME && this.types[exts]) { 27 | console.warn(this._loading.replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + 28 | this.types[exts] + ' to ' + type); 29 | } 30 | 31 | this.types[exts[i]] = type; 32 | } 33 | 34 | // Default extension is the first one we encounter 35 | if (!this.extensions[type]) { 36 | this.extensions[type] = exts[0]; 37 | } 38 | } 39 | }; 40 | 41 | /** 42 | * Load an Apache2-style ".types" file 43 | * 44 | * This may be called multiple times (it's expected). Where files declare 45 | * overlapping types/extensions, the last file wins. 46 | * 47 | * @param file (String) path of file to load. 48 | */ 49 | Mime.prototype.load = function(file) { 50 | 51 | this._loading = file; 52 | // Read file and split into lines 53 | var map = {}, 54 | content = fs.readFileSync(file, 'ascii'), 55 | lines = content.split(/[\r\n]+/); 56 | 57 | lines.forEach(function(line) { 58 | // Clean up whitespace/comments, and split into fields 59 | var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); 60 | map[fields.shift()] = fields; 61 | }); 62 | 63 | this.define(map); 64 | 65 | this._loading = null; 66 | }; 67 | 68 | /** 69 | * Lookup a mime type based on extension 70 | */ 71 | Mime.prototype.lookup = function(path, fallback) { 72 | var ext = path.replace(/.*[\.\/\\]/, '').toLowerCase(); 73 | 74 | return this.types[ext] || fallback || this.default_type; 75 | }; 76 | 77 | /** 78 | * Return file extension associated with a mime type 79 | */ 80 | Mime.prototype.extension = function(mimeType) { 81 | var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); 82 | return this.extensions[type]; 83 | }; 84 | 85 | // Default instance 86 | var mime = new Mime(); 87 | 88 | // Load local copy of 89 | // http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types 90 | mime.load(path.join(__dirname, 'types/mime.types')); 91 | 92 | // Load additional types from node.js community 93 | mime.load(path.join(__dirname, 'types/node.types')); 94 | 95 | // Default type 96 | mime.default_type = mime.lookup('bin'); 97 | 98 | // 99 | // Additional API specific to the default instance 100 | // 101 | 102 | mime.Mime = Mime; 103 | 104 | /** 105 | * Lookup a charset based on mime type. 106 | */ 107 | mime.charsets = { 108 | lookup: function(mimeType, fallback) { 109 | // Assume text types are utf8 110 | return (/^text\//).test(mimeType) ? 'UTF-8' : fallback; 111 | } 112 | }; 113 | 114 | module.exports = mime; 115 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/node_modules/mime/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Robert Kieffer", 4 | "email": "robert@broofa.com", 5 | "url": "http://github.com/broofa" 6 | }, 7 | "contributors": [ 8 | { 9 | "name": "Benjamin Thomas", 10 | "email": "benjamin@benjaminthomas.org", 11 | "url": "http://github.com/bentomas" 12 | } 13 | ], 14 | "dependencies": {}, 15 | "description": "A comprehensive library for mime-type mapping", 16 | "devDependencies": {}, 17 | "keywords": [ 18 | "util", 19 | "mime" 20 | ], 21 | "main": "mime.js", 22 | "name": "mime", 23 | "repository": { 24 | "url": "https://github.com/broofa/node-mime", 25 | "type": "git" 26 | }, 27 | "version": "1.2.11", 28 | "readme": "# mime\n\nComprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n npm install mime\n\n## API - Queries\n\n### mime.lookup(path)\nGet the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g.\n\n var mime = require('mime');\n\n mime.lookup('/path/to/file.txt'); // => 'text/plain'\n mime.lookup('file.txt'); // => 'text/plain'\n mime.lookup('.TXT'); // => 'text/plain'\n mime.lookup('htm'); // => 'text/html'\n\n### mime.default_type\nSets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)\n\n### mime.extension(type)\nGet the default extension for `type`\n\n mime.extension('text/html'); // => 'html'\n mime.extension('application/octet-stream'); // => 'bin'\n\n### mime.charsets.lookup()\n\nMap mime-type to charset\n\n mime.charsets.lookup('text/plain'); // => 'UTF-8'\n\n(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.)\n\n## API - Defining Custom Types\n\nThe following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types).\n\n### mime.define()\n\nAdd custom mime/extension mappings\n\n mime.define({\n 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n 'application/x-my-type': ['x-mt', 'x-mtt'],\n // etc ...\n });\n\n mime.lookup('x-sft'); // => 'text/x-some-format'\n\nThe first entry in the extensions array is returned by `mime.extension()`. E.g.\n\n mime.extension('text/x-some-format'); // => 'x-sf'\n\n### mime.load(filepath)\n\nLoad mappings from an Apache \".types\" format file\n\n mime.load('./my_project.types');\n\nThe .types file format is simple - See the `types` dir for examples.\n", 29 | "readmeFilename": "README.md", 30 | "bugs": { 31 | "url": "https://github.com/broofa/node-mime/issues" 32 | }, 33 | "homepage": "https://github.com/broofa/node-mime", 34 | "_id": "mime@1.2.11", 35 | "_from": "mime@1.2.11" 36 | } 37 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/node_modules/mime/test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Usage: node test.js 3 | */ 4 | 5 | var mime = require('./mime'); 6 | var assert = require('assert'); 7 | var path = require('path'); 8 | 9 | function eq(a, b) { 10 | console.log('Test: ' + a + ' === ' + b); 11 | assert.strictEqual.apply(null, arguments); 12 | } 13 | 14 | console.log(Object.keys(mime.extensions).length + ' types'); 15 | console.log(Object.keys(mime.types).length + ' extensions\n'); 16 | 17 | // 18 | // Test mime lookups 19 | // 20 | 21 | eq('text/plain', mime.lookup('text.txt')); // normal file 22 | eq('text/plain', mime.lookup('TEXT.TXT')); // uppercase 23 | eq('text/plain', mime.lookup('dir/text.txt')); // dir + file 24 | eq('text/plain', mime.lookup('.text.txt')); // hidden file 25 | eq('text/plain', mime.lookup('.txt')); // nameless 26 | eq('text/plain', mime.lookup('txt')); // extension-only 27 | eq('text/plain', mime.lookup('/txt')); // extension-less () 28 | eq('text/plain', mime.lookup('\\txt')); // Windows, extension-less 29 | eq('application/octet-stream', mime.lookup('text.nope')); // unrecognized 30 | eq('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default 31 | 32 | // 33 | // Test extensions 34 | // 35 | 36 | eq('txt', mime.extension(mime.types.text)); 37 | eq('html', mime.extension(mime.types.htm)); 38 | eq('bin', mime.extension('application/octet-stream')); 39 | eq('bin', mime.extension('application/octet-stream ')); 40 | eq('html', mime.extension(' text/html; charset=UTF-8')); 41 | eq('html', mime.extension('text/html; charset=UTF-8 ')); 42 | eq('html', mime.extension('text/html; charset=UTF-8')); 43 | eq('html', mime.extension('text/html ; charset=UTF-8')); 44 | eq('html', mime.extension('text/html;charset=UTF-8')); 45 | eq('html', mime.extension('text/Html;charset=UTF-8')); 46 | eq(undefined, mime.extension('unrecognized')); 47 | 48 | // 49 | // Test node.types lookups 50 | // 51 | 52 | eq('application/font-woff', mime.lookup('file.woff')); 53 | eq('application/octet-stream', mime.lookup('file.buffer')); 54 | eq('audio/mp4', mime.lookup('file.m4a')); 55 | eq('font/opentype', mime.lookup('file.otf')); 56 | 57 | // 58 | // Test charsets 59 | // 60 | 61 | eq('UTF-8', mime.charsets.lookup('text/plain')); 62 | eq(undefined, mime.charsets.lookup(mime.types.js)); 63 | eq('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); 64 | 65 | // 66 | // Test for overlaps between mime.types and node.types 67 | // 68 | 69 | var apacheTypes = new mime.Mime(), nodeTypes = new mime.Mime(); 70 | apacheTypes.load(path.join(__dirname, 'types/mime.types')); 71 | nodeTypes.load(path.join(__dirname, 'types/node.types')); 72 | 73 | var keys = [].concat(Object.keys(apacheTypes.types)) 74 | .concat(Object.keys(nodeTypes.types)); 75 | keys.sort(); 76 | for (var i = 1; i < keys.length; i++) { 77 | if (keys[i] == keys[i-1]) { 78 | console.warn('Warning: ' + 79 | 'node.types defines ' + keys[i] + '->' + nodeTypes.types[keys[i]] + 80 | ', mime.types defines ' + keys[i] + '->' + apacheTypes.types[keys[i]]); 81 | } 82 | } 83 | 84 | console.log('\nOK'); 85 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/node_modules/mime/types/node.types: -------------------------------------------------------------------------------- 1 | # What: WebVTT 2 | # Why: To allow formats intended for marking up external text track resources. 3 | # http://dev.w3.org/html5/webvtt/ 4 | # Added by: niftylettuce 5 | text/vtt vtt 6 | 7 | # What: Google Chrome Extension 8 | # Why: To allow apps to (work) be served with the right content type header. 9 | # http://codereview.chromium.org/2830017 10 | # Added by: niftylettuce 11 | application/x-chrome-extension crx 12 | 13 | # What: HTC support 14 | # Why: To properly render .htc files such as CSS3PIE 15 | # Added by: niftylettuce 16 | text/x-component htc 17 | 18 | # What: HTML5 application cache manifes ('.manifest' extension) 19 | # Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps 20 | # per https://developer.mozilla.org/en/offline_resources_in_firefox 21 | # Added by: louisremi 22 | text/cache-manifest manifest 23 | 24 | # What: node binary buffer format 25 | # Why: semi-standard extension w/in the node community 26 | # Added by: tootallnate 27 | application/octet-stream buffer 28 | 29 | # What: The "protected" MP-4 formats used by iTunes. 30 | # Why: Required for streaming music to browsers (?) 31 | # Added by: broofa 32 | application/mp4 m4p 33 | audio/mp4 m4a 34 | 35 | # What: Video format, Part of RFC1890 36 | # Why: See https://github.com/bentomas/node-mime/pull/6 37 | # Added by: mjrusso 38 | video/MP2T ts 39 | 40 | # What: EventSource mime type 41 | # Why: mime type of Server-Sent Events stream 42 | # http://www.w3.org/TR/eventsource/#text-event-stream 43 | # Added by: francois2metz 44 | text/event-stream event-stream 45 | 46 | # What: Mozilla App manifest mime type 47 | # Why: https://developer.mozilla.org/en/Apps/Manifest#Serving_manifests 48 | # Added by: ednapiranha 49 | application/x-web-app-manifest+json webapp 50 | 51 | # What: Lua file types 52 | # Why: Googling around shows de-facto consensus on these 53 | # Added by: creationix (Issue #45) 54 | text/x-lua lua 55 | application/x-lua-bytecode luac 56 | 57 | # What: Markdown files, as per http://daringfireball.net/projects/markdown/syntax 58 | # Why: http://stackoverflow.com/questions/10701983/what-is-the-mime-type-for-markdown 59 | # Added by: avoidwork 60 | text/x-markdown markdown md mkd 61 | 62 | # What: ini files 63 | # Why: because they're just text files 64 | # Added by: Matthew Kastor 65 | text/plain ini 66 | 67 | # What: DASH Adaptive Streaming manifest 68 | # Why: https://developer.mozilla.org/en-US/docs/DASH_Adaptive_Streaming_for_HTML_5_Video 69 | # Added by: eelcocramer 70 | application/dash+xml mdp 71 | 72 | # What: OpenType font files - http://www.microsoft.com/typography/otspec/ 73 | # Why: Browsers usually ignore the font MIME types and sniff the content, 74 | # but Chrome, shows a warning if OpenType fonts aren't served with 75 | # the `font/opentype` MIME type: http://i.imgur.com/8c5RN8M.png. 76 | # Added by: alrra 77 | font/opentype otf 78 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/body-parser/node_modules/type-is/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "type-is", 3 | "description": "Infer the content type if a request", 4 | "version": "1.2.0", 5 | "author": { 6 | "name": "Jonathan Ong", 7 | "email": "me@jongleberry.com", 8 | "url": "http://jongleberry.com" 9 | }, 10 | "contributors": [ 11 | { 12 | "name": "Douglas Christopher Wilson", 13 | "email": "doug@somethingdoug.com" 14 | } 15 | ], 16 | "license": "MIT", 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/expressjs/type-is" 20 | }, 21 | "dependencies": { 22 | "mime": "1.2.11" 23 | }, 24 | "devDependencies": { 25 | "mocha": "*", 26 | "should": "*" 27 | }, 28 | "engines": { 29 | "node": ">= 0.8" 30 | }, 31 | "scripts": { 32 | "test": "mocha --require should --reporter spec --bail" 33 | }, 34 | "readme": "# type-is [![Build Status](https://travis-ci.org/expressjs/type-is.svg?branch=master)](https://travis-ci.org/expressjs/type-is) [![NPM version](https://badge.fury.io/js/type-is.svg)](https://badge.fury.io/js/type-is)\n\nInfer the content type of a request. \nExtracted from [koa](https://github.com/koajs/koa) for general use.\n\nHere's an example body parser:\n\n```js\nvar is = require('type-is');\nvar parse = require('body');\nvar busboy = require('busboy');\n\nfunction bodyParser(req, res, next) {\n var hasRequestBody = 'content-type' in req.headers\n || 'transfer-encoding' in req.headers;\n if (!hasRequestBody) return next();\n \n switch (is(req, ['urlencoded', 'json', 'multipart'])) {\n case 'urlencoded':\n // parse urlencoded body\n break\n case 'json':\n // parse json body\n break\n case 'multipart':\n // parse multipart body\n break\n default:\n // 415 error code\n }\n}\n```\n\n## API\n\n### var type = is(request, types)\n\n```js\nvar is = require('type-is')\n\nhttp.createServer(function (req, res) {\n is(req, ['text/*'])\n})\n```\n\n`request` is the node HTTP request. `types` is an array of types. Each type can be:\n\n- An extension name such as `json`. This name will be returned if matched.\n- A mime type such as `application/json`.\n- A mime type with a wildcard such as `*/json` or `application/*`. The full mime type will be returned if matched\n- A suffix such as `+json`. This can be combined with a wildcard such as `*/vnd+json` or `application/*+json`. The full mime type will be returned if matched.\n\n`false` will be returned if no type matches.\n\nExamples:\n\n```js\n// req.headers.content-type = 'application/json'\nis(req, ['json']) // -> 'json'\nis(req, ['html', 'json']) // -> 'json'\nis(req, ['application/*']) // -> 'application/json'\nis(req, ['application/json']) // -> 'application/json'\nis(req, ['html']) // -> false\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Jonathan Ong me@jongleberry.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", 35 | "readmeFilename": "README.md", 36 | "bugs": { 37 | "url": "https://github.com/expressjs/type-is/issues" 38 | }, 39 | "homepage": "https://github.com/expressjs/type-is", 40 | "_id": "type-is@1.2.0", 41 | "_from": "type-is@1.2.0" 42 | } 43 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/compilex/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/compilex/.npmignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | 46 | [Dd]ebug/ 47 | [Rr]elease/ 48 | x64/ 49 | build/ 50 | [Bb]in/ 51 | [Oo]bj/ 52 | 53 | # MSTest test Results 54 | [Tt]est[Rr]esult*/ 55 | [Bb]uild[Ll]og.* 56 | 57 | *_i.c 58 | *_p.c 59 | *.ilk 60 | *.meta 61 | *.obj 62 | *.pch 63 | *.pdb 64 | *.pgc 65 | *.pgd 66 | *.rsp 67 | *.sbr 68 | *.tlb 69 | *.tli 70 | *.tlh 71 | *.tmp 72 | *.tmp_proj 73 | *.log 74 | *.vspscc 75 | *.vssscc 76 | .builds 77 | *.pidb 78 | *.log 79 | *.scc 80 | 81 | # Visual C++ cache files 82 | ipch/ 83 | *.aps 84 | *.ncb 85 | *.opensdf 86 | *.sdf 87 | *.cachefile 88 | 89 | # Visual Studio profiler 90 | *.psess 91 | *.vsp 92 | *.vspx 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | 101 | # TeamCity is a build add-in 102 | _TeamCity* 103 | 104 | # DotCover is a Code Coverage Tool 105 | *.dotCover 106 | 107 | # NCrunch 108 | *.ncrunch* 109 | .*crunch*.local.xml 110 | 111 | # Installshield output folder 112 | [Ee]xpress/ 113 | 114 | # DocProject is a documentation generator add-in 115 | DocProject/buildhelp/ 116 | DocProject/Help/*.HxT 117 | DocProject/Help/*.HxC 118 | DocProject/Help/*.hhc 119 | DocProject/Help/*.hhk 120 | DocProject/Help/*.hhp 121 | DocProject/Help/Html2 122 | DocProject/Help/html 123 | 124 | # Click-Once directory 125 | publish/ 126 | 127 | # Publish Web Output 128 | *.Publish.xml 129 | *.pubxml 130 | 131 | # NuGet Packages Directory 132 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 133 | #packages/ 134 | 135 | # Windows Azure Build Output 136 | csx 137 | *.build.csdef 138 | 139 | # Windows Store app package directory 140 | AppPackages/ 141 | 142 | # Others 143 | sql/ 144 | *.Cache 145 | ClientBin/ 146 | [Ss]tyle[Cc]op.* 147 | ~$* 148 | *~ 149 | *.dbmdl 150 | *.[Pp]ublish.xml 151 | *.pfx 152 | *.publishsettings 153 | 154 | # RIA/Silverlight projects 155 | Generated_Code/ 156 | 157 | # Backup & report files from converting an old project file to a newer 158 | # Visual Studio version. Backup files are not needed, because we have git ;-) 159 | _UpgradeReport_Files/ 160 | Backup*/ 161 | UpgradeLog*.XML 162 | UpgradeLog*.htm 163 | 164 | # SQL Server files 165 | App_Data/*.mdf 166 | App_Data/*.ldf 167 | 168 | ############# 169 | ## Windows detritus 170 | ############# 171 | 172 | # Windows image file caches 173 | Thumbs.db 174 | ehthumbs.db 175 | 176 | # Folder config file 177 | Desktop.ini 178 | 179 | # Recycle Bin used on file shares 180 | $RECYCLE.BIN/ 181 | 182 | # Mac crap 183 | .DS_Store 184 | 185 | 186 | ############# 187 | ## Python 188 | ############# 189 | 190 | *.py[co] 191 | 192 | # Packages 193 | *.egg 194 | *.egg-info 195 | dist/ 196 | build/ 197 | eggs/ 198 | parts/ 199 | var/ 200 | sdist/ 201 | develop-eggs/ 202 | .installed.cfg 203 | 204 | # Installer logs 205 | pip-log.txt 206 | 207 | # Unit test / coverage reports 208 | .coverage 209 | .tox 210 | 211 | #Translations 212 | *.mo 213 | 214 | #Mr Developer 215 | .mr.developer.cfg 216 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/compilex/License.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright (c) 2014 Vishnu Bharathi 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/compilex/README.md: -------------------------------------------------------------------------------- 1 | compileX 2 | ======== 3 | compileX is a node.js library which is used to build online code editor/compiler websites and webservices. 4 | 5 | You can compile and respond back outputs for all the languages that can be compiled by the server. 6 | 7 | Some of the online code compiling/judging websites are 8 | 14 | Using compileX , you can built sites and services like the above said examples. 15 | 16 | 17 | 18 | Work Flow 19 | ========= 20 | 1)Get the program as input from the client as a request
21 | 2)Use compileX modules to compile the program
22 | 3)Get the output as String
23 | 4)Respond the output to the client
24 | 25 | Mandatory Steps 26 | =============== 27 | Inorder to compile any programming language , you need to first have the compiler for that programming language in the server machine. 28 | 29 | The beta version of compileX supports the compilation of C and C++ only . I am sure that you could expect the successive builds with more programming languages added. I also look forward for some contributions to the repo.So feel free to play with compileX 30 | 31 |

Compiling C and C++

32 |
    33 |
  1. Installation :You need GCC compiler that can compile programs from your cmd/terminal 34 |
      35 |
    • Windows - You can get MinGw .
    • 36 |
    • Linux - Most of the linux versions are installed with gcc by default. If you haven't got , Take a look at Installing GCC .
    • 37 |
    38 |
  2. 39 |
  3. Testing the Environment :After installing , set your environment variables for accessing the GCC command lines from any directory 40 |
      41 |
    • Windows - create a c file in a directory , execute
      42 | g++ filename.c -o output.exe
      43 | output.exe

      44 | then you will get the output of the program
    • 45 |
    • Linux - create a c file in a directory , execute
      46 | gcc filename.c -o output.out
      47 | ./output.out

      48 | then you will get the output of the program
    • 49 |
    50 |
  4. Jump Start : get compileX via npm
    51 | npm install compilex
    52 |
  5. 53 |
54 | 55 | 56 | Documentation 57 | ============= 58 |
1)Require compileX
59 | ```javascript 60 | var compiler = require('compilex'); 61 | compiler.init(); 62 | ``` 63 | init() creates a folder named temp in your project directory which is used for storage purpose. 64 | Before using other methods , make sure to call init() method. 65 | 66 |
2)Compiling C and C++
67 | ```javascript 68 | //if windows 69 | var envData = { OS : "windows" , cmd : "g++"}; // (uses g++ command to compile ) 70 | //else 71 | var envData = { OS : "linux" , cmd : "gcc" }; // ( uses gcc command to compile ) 72 | compiler.compileCPP(envData , code , function (output) { 73 | res.send(output); 74 | }); 75 | 76 | //res is the response object 77 | ``` 78 | 79 |
3)Compiling C and C++ with inputs ( providing stdin )
80 | ```javascript 81 | //if windows 82 | var envData = { OS : "windows" , cmd : "g++"}; // (uses g++ command to compile ) 83 | //else 84 | var envData = { OS : "linux" , cmd : "gcc" }; // ( uses gcc command to compile ) 85 | compiler.compileCPPWithInput(envData , code , input , function (output) { 86 | res.send(output); 87 | }); 88 | 89 | //res is the response object 90 | ``` 91 | 92 |
4)Memory Management
93 | All the temporary files ( source code and executables ) are created in your temp directory. 94 | flush and flushSync helps you to free the memory by deleting the temporary files. 95 | ```javascript 96 | compiler.flush(function(){ 97 | console.log('All temporary files flushed !'); 98 | }); 99 | ``` 100 | Synchronous version of flush 101 | ```javascript 102 | compiler.flushSync(); 103 | ``` 104 | Examples 105 | ======== 106 | You can find examples here.The examples are downloaded everytime you download compileX via npm. 107 | you can begin with editing CSS and publish your site in minutes. 108 | 109 | License 110 | ======= 111 | All the contents in this repository are released under the MIT License . 112 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/examples/compilex-Demo1/node_modules/compilex/compilex.js: -------------------------------------------------------------------------------- 1 | var exec = require('child_process').exec; 2 | var fs = require('fs'); 3 | var cuid = require('cuid'); 4 | var colors = require('colors'); 5 | var cppModule = require('./cppModule.js'); 6 | var javaModule = require('./javaModule.js'); 7 | var pyModule = require('./pyModule.js'); 8 | 9 | exports.stats = false; 10 | 11 | exports.init = function(option){ 12 | if(option) 13 | { 14 | if(option.stats === true ) 15 | { 16 | console.log('Statistics for compilex is On'.green); 17 | exports.stats = true; 18 | } 19 | } 20 | fs.exists( './temp' , function(exists){ 21 | if(!exists) 22 | { 23 | if(exports.stats) 24 | { 25 | console.log('INFO: '.cyan + 'temp directory created for storing temporary files.'.cyan ) 26 | } 27 | fs.mkdirSync('./temp'); 28 | } 29 | }); 30 | } 31 | 32 | exports.compileCPP = function ( envData , code , fn ){ 33 | if(exports.stats) 34 | cppModule.stats = true; 35 | cppModule.compileCPP(envData , code , fn ); 36 | } 37 | 38 | exports.compileCPPWithInput = function ( envData , code , input , fn ) { 39 | if(exports.stats) 40 | cppModule.stats = true; 41 | cppModule.compileCPPWithInput(envData , code , input , fn ); 42 | } 43 | 44 | 45 | exports.compileJava = function ( envData , code , fn ){ 46 | if(exports.stats) 47 | javaModule.stats = true; 48 | javaModule.compileJava(envData , code,fn); 49 | } 50 | 51 | exports.compileJavaWithInput = function ( envData , code , input , fn ){ 52 | if(exports.stats) 53 | javaModule.stats = true; 54 | javaModule.compileJavaWithInput( envData , code , input , fn ); 55 | } 56 | 57 | exports.compilePython = function ( envData , code , fn ){ 58 | if(exports.stats) 59 | pyModule.stats = true; 60 | pyModule.compilePython(envData , code , fn ); 61 | } 62 | 63 | exports.compilePythonWithInput = function( envData , code , input , fn){ 64 | if(exports.stats) 65 | pyModule.stats = true; 66 | pyModule.compilePythonWithInput(envData , code , input , fn ); 67 | 68 | } 69 | 70 | 71 | exports.flushSync = function() { 72 | path = ' ./temp/'; 73 | fs.readdir(path, function(err , files){ 74 | if(!err) 75 | { 76 | for( var i = 0 ; i 4 | 5 | 6 | ## Installation 7 | 8 | npm install colors 9 | 10 | ## colors and styles! 11 | 12 | - bold 13 | - italic 14 | - underline 15 | - inverse 16 | - yellow 17 | - cyan 18 | - white 19 | - magenta 20 | - green 21 | - red 22 | - grey 23 | - blue 24 | - rainbow 25 | - zebra 26 | - random 27 | 28 | ## Usage 29 | 30 | ``` js 31 | var colors = require('./colors'); 32 | 33 | console.log('hello'.green); // outputs green text 34 | console.log('i like cake and pies'.underline.red) // outputs red underlined text 35 | console.log('inverse the color'.inverse); // inverses the color 36 | console.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces) 37 | ``` 38 | 39 | # Creating Custom themes 40 | 41 | ```js 42 | 43 | var colors = require('colors'); 44 | 45 | colors.setTheme({ 46 | silly: 'rainbow', 47 | input: 'grey', 48 | verbose: 'cyan', 49 | prompt: 'grey', 50 | info: 'green', 51 | data: 'grey', 52 | help: 'cyan', 53 | warn: 'yellow', 54 | debug: 'blue', 55 | error: 'red' 56 | }); 57 | 58 | // outputs red text 59 | console.log("this is an error".error); 60 | 61 | // outputs yellow text 62 | console.log("this is a warning".warn); 63 | ``` 64 | 65 | 66 | ### Contributors 67 | 68 | Marak (Marak Squires) 69 | Alexis Sellier (cloudhead) 70 | mmalecki (Maciej Małecki) 71 | nicoreed (Nico Reed) 72 | morganrallen (Morgan Allen) 73 | JustinCampbell (Justin Campbell) 74 | ded (Dustin Diaz) 75 | 76 | 77 | #### , Marak Squires , Justin Campbell, Dustin Diaz (@ded) 78 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/colors/example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Colors Example 6 | 7 | 8 | 9 | 75 | 76 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/colors/example.js: -------------------------------------------------------------------------------- 1 | var colors = require('./colors'); 2 | 3 | //colors.mode = "browser"; 4 | 5 | var test = colors.red("hopefully colorless output"); 6 | console.log('Rainbows are fun!'.rainbow); 7 | console.log('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported 8 | console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported 9 | //console.log('zalgo time!'.zalgo); 10 | console.log(test.stripColors); 11 | console.log("a".grey + " b".black); 12 | console.log("Zebras are so fun!".zebra); 13 | console.log('background color attack!'.black.whiteBG) 14 | 15 | // 16 | // Remark: .strikethrough may not work with Mac OS Terminal App 17 | // 18 | console.log("This is " + "not".strikethrough + " fun."); 19 | console.log(colors.rainbow('Rainbows are fun!')); 20 | console.log(colors.italic('So ') + colors.underline('are') + colors.bold(' styles! ') + colors.inverse('inverse')); // styles not widely supported 21 | console.log(colors.bold(colors.italic(colors.underline(colors.red('Chains are also cool.'))))); // styles not widely supported 22 | //console.log(colors.zalgo('zalgo time!')); 23 | console.log(colors.stripColors(test)); 24 | console.log(colors.grey("a") + colors.black(" b")); 25 | 26 | colors.addSequencer("america", function(letter, i, exploded) { 27 | if(letter === " ") return letter; 28 | switch(i%3) { 29 | case 0: return letter.red; 30 | case 1: return letter.white; 31 | case 2: return letter.blue; 32 | } 33 | }); 34 | 35 | colors.addSequencer("random", (function() { 36 | var available = ['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta']; 37 | 38 | return function(letter, i, exploded) { 39 | return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]]; 40 | }; 41 | })()); 42 | 43 | console.log("AMERICA! F--K YEAH!".america); 44 | console.log("So apparently I've been to Mars, with all the little green men. But you know, I don't recall.".random); 45 | 46 | // 47 | // Custom themes 48 | // 49 | 50 | // Load theme with JSON literal 51 | colors.setTheme({ 52 | silly: 'rainbow', 53 | input: 'grey', 54 | verbose: 'cyan', 55 | prompt: 'grey', 56 | info: 'green', 57 | data: 'grey', 58 | help: 'cyan', 59 | warn: 'yellow', 60 | debug: 'blue', 61 | error: 'red' 62 | }); 63 | 64 | // outputs red text 65 | console.log("this is an error".error); 66 | 67 | // outputs yellow text 68 | console.log("this is a warning".warn); 69 | 70 | // outputs grey text 71 | console.log("this is an input".input); 72 | 73 | // Load a theme from file 74 | colors.setTheme('./themes/winston-dark.js'); 75 | 76 | console.log("this is an input".input); 77 | 78 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/colors/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "colors", 3 | "description": "get colors in your node.js console like what", 4 | "version": "0.6.2", 5 | "author": { 6 | "name": "Marak Squires" 7 | }, 8 | "homepage": "https://github.com/Marak/colors.js", 9 | "bugs": { 10 | "url": "https://github.com/Marak/colors.js/issues" 11 | }, 12 | "keywords": [ 13 | "ansi", 14 | "terminal", 15 | "colors" 16 | ], 17 | "repository": { 18 | "type": "git", 19 | "url": "http://github.com/Marak/colors.js.git" 20 | }, 21 | "engines": { 22 | "node": ">=0.1.90" 23 | }, 24 | "main": "colors", 25 | "readme": "# colors.js - get color and style in your node.js console ( and browser ) like what\n\n\n\n\n## Installation\n\n npm install colors\n\n## colors and styles!\n\n- bold\n- italic\n- underline\n- inverse\n- yellow\n- cyan\n- white\n- magenta\n- green\n- red\n- grey\n- blue\n- rainbow\n- zebra\n- random\n\n## Usage\n\n``` js\nvar colors = require('./colors');\n\nconsole.log('hello'.green); // outputs green text\nconsole.log('i like cake and pies'.underline.red) // outputs red underlined text\nconsole.log('inverse the color'.inverse); // inverses the color\nconsole.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces)\n```\n\n# Creating Custom themes\n\n```js\n\nvar colors = require('colors');\n\ncolors.setTheme({\n silly: 'rainbow',\n input: 'grey',\n verbose: 'cyan',\n prompt: 'grey',\n info: 'green',\n data: 'grey',\n help: 'cyan',\n warn: 'yellow',\n debug: 'blue',\n error: 'red'\n});\n\n// outputs red text\nconsole.log(\"this is an error\".error);\n\n// outputs yellow text\nconsole.log(\"this is a warning\".warn);\n```\n\n\n### Contributors \n\nMarak (Marak Squires)\nAlexis Sellier (cloudhead)\nmmalecki (Maciej Małecki)\nnicoreed (Nico Reed)\nmorganrallen (Morgan Allen)\nJustinCampbell (Justin Campbell)\nded (Dustin Diaz)\n\n\n#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded)\n", 26 | "readmeFilename": "ReadMe.md", 27 | "_id": "colors@0.6.2", 28 | "_from": "colors@~0.6.2" 29 | } 30 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/colors/test.js: -------------------------------------------------------------------------------- 1 | var assert = require('assert'), 2 | colors = require('./colors'); 3 | 4 | var s = 'string'; 5 | 6 | function a(s, code) { 7 | return '\x1B[' + code.toString() + 'm' + s + '\x1B[39m'; 8 | } 9 | 10 | function aE(s, color, code) { 11 | assert.equal(s[color], a(s, code)); 12 | assert.equal(colors[color](s), a(s, code)); 13 | assert.equal(s[color], colors[color](s)); 14 | assert.equal(s[color].stripColors, s); 15 | assert.equal(s[color].stripColors, colors.stripColors(s)); 16 | } 17 | 18 | function h(s, color) { 19 | return '' + s + ''; 20 | } 21 | 22 | var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow']; 23 | var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']); 24 | 25 | colors.mode = 'console'; 26 | assert.equal(s.bold, '\x1B[1m' + s + '\x1B[22m'); 27 | assert.equal(s.italic, '\x1B[3m' + s + '\x1B[23m'); 28 | assert.equal(s.underline, '\x1B[4m' + s + '\x1B[24m'); 29 | assert.equal(s.strikethrough, '\x1B[9m' + s + '\x1B[29m'); 30 | assert.equal(s.inverse, '\x1B[7m' + s + '\x1B[27m'); 31 | assert.ok(s.rainbow); 32 | aE(s, 'white', 37); 33 | aE(s, 'grey', 90); 34 | aE(s, 'black', 30); 35 | aE(s, 'blue', 34); 36 | aE(s, 'cyan', 36); 37 | aE(s, 'green', 32); 38 | aE(s, 'magenta', 35); 39 | aE(s, 'red', 31); 40 | aE(s, 'yellow', 33); 41 | assert.equal(s, 'string'); 42 | 43 | colors.setTheme({error:'red'}); 44 | 45 | assert.equal(typeof("astring".red),'string'); 46 | assert.equal(typeof("astring".error),'string'); 47 | 48 | colors.mode = 'browser'; 49 | assert.equal(s.bold, '' + s + ''); 50 | assert.equal(s.italic, '' + s + ''); 51 | assert.equal(s.underline, '' + s + ''); 52 | assert.equal(s.strikethrough, '' + s + ''); 53 | assert.equal(s.inverse, '' + s + ''); 54 | assert.ok(s.rainbow); 55 | stylesColors.forEach(function (color) { 56 | assert.equal(s[color], h(s, color)); 57 | assert.equal(colors[color](s), h(s, color)); 58 | }); 59 | 60 | assert.equal(typeof("astring".red),'string'); 61 | assert.equal(typeof("astring".error),'string'); 62 | 63 | colors.mode = 'none'; 64 | stylesAll.forEach(function (style) { 65 | assert.equal(s[style], s); 66 | assert.equal(colors[style](s), s); 67 | }); 68 | 69 | assert.equal(typeof("astring".red),'string'); 70 | assert.equal(typeof("astring".error),'string'); 71 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/colors/themes/winston-dark.js: -------------------------------------------------------------------------------- 1 | module['exports'] = { 2 | silly: 'rainbow', 3 | input: 'black', 4 | verbose: 'cyan', 5 | prompt: 'grey', 6 | info: 'green', 7 | data: 'grey', 8 | help: 'cyan', 9 | warn: 'yellow', 10 | debug: 'blue', 11 | error: 'red' 12 | }; -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/colors/themes/winston-light.js: -------------------------------------------------------------------------------- 1 | module['exports'] = { 2 | silly: 'rainbow', 3 | input: 'grey', 4 | verbose: 'cyan', 5 | prompt: 'grey', 6 | info: 'green', 7 | data: 'grey', 8 | help: 'cyan', 9 | warn: 'yellow', 10 | debug: 'blue', 11 | error: 'red' 12 | }; -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/cuid/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/cuid/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/cuid/LICENSE: -------------------------------------------------------------------------------- 1 | cuid is covered by The MIT License: 2 | 3 | Copyright (c) 2012 Eric Elliott 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/cuid/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cuid", 3 | "repo": "dilvie/cuid", 4 | "description": "Collision-resistant ids optimized for horizontal scaling and performance", 5 | "version": "1.2.2", 6 | "keywords": [ 7 | "uid", 8 | "unique id", 9 | "guid", 10 | "uuid" 11 | ], 12 | "dependencies": {}, 13 | "development": {}, 14 | "license": "MIT", 15 | "main": "dist/browser-cuid.js", 16 | "scripts": [ 17 | "dist/browser-cuid.js" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/cuid/grunt.js: -------------------------------------------------------------------------------- 1 | /*global module*/ 2 | module.exports = function(grunt) { 3 | 'use strict'; 4 | grunt.initConfig({ 5 | pkg: '', 6 | lint: { 7 | all: ['./grunt.js', './dist/*.js', './test/test.js'] 8 | }, 9 | jshint: { 10 | options: { 11 | curly: true, 12 | eqeqeq: true, 13 | immed: true, 14 | latedef: true, 15 | newcap: true, 16 | nonew: true, 17 | noarg: true, 18 | sub: true, 19 | undef: true, 20 | unused: true, 21 | eqnull: true, 22 | browser: true, 23 | strict: true, 24 | boss: false 25 | } 26 | }, 27 | concat: { 28 | applitude: { 29 | src: ['node_modules/applitude/dist/applitude.bundle.js'], 30 | dest: 'lib/applitude.bundle.js' 31 | }, 32 | browser: { 33 | src: ['src/head.js', 'src/browser-fingerprint.js', 'src/footer.js'], 34 | dest: 'dist/browser-cuid.js' 35 | }, 36 | node: { 37 | src: ['src/head.js', 'src/node-fingerprint.js', 'src/footer.js'], 38 | dest: 'dist/node-cuid.js' 39 | } 40 | }, 41 | qunit: { 42 | applitude: ['test/applitude-cuid-test.html'], 43 | browser: ['test/browser-cuid-test.html'] 44 | }, 45 | test: { 46 | "node-cuid": ['test/node-cuid-test.js'] 47 | } 48 | }); 49 | grunt.registerTask('testall', 'qunit test'); 50 | grunt.registerTask('default', 'concat lint'); 51 | grunt.registerTask('install', 'concat'); 52 | }; 53 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/cuid/src/browser-fingerprint.js: -------------------------------------------------------------------------------- 1 | api.globalCount = function globalCount() { 2 | // We want to cache the results of this 3 | var cache = (function calc() { 4 | var i, 5 | count = 0; 6 | 7 | for (i in window) { 8 | count++; 9 | } 10 | 11 | return count; 12 | }()); 13 | 14 | api.globalCount = function () { return cache; }; 15 | return cache; 16 | }; 17 | 18 | api.fingerprint = function browserPrint() { 19 | return pad((navigator.mimeTypes.length + 20 | navigator.userAgent.length).toString(36) + 21 | api.globalCount().toString(36), 4); 22 | }; -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/cuid/src/footer.js: -------------------------------------------------------------------------------- 1 | 2 | // don't change anything from here down. 3 | if (app.register) { 4 | app.register(namespace, api); 5 | } else if (typeof module !== 'undefined') { 6 | module.exports = api; 7 | } else { 8 | app[namespace] = api; 9 | } 10 | 11 | }(this.applitude || this)); 12 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/cuid/src/head.js: -------------------------------------------------------------------------------- 1 | /** 2 | * cuid.js 3 | * Collision-resistant UID generator for browsers and node. 4 | * Sequential for fast db lookups and recency sorting. 5 | * Safe for element IDs and server-side lookups. 6 | * 7 | * Extracted from CLCTR 8 | * 9 | * Copyright (c) Eric Elliott 2012 10 | * MIT License 11 | */ 12 | 13 | /*global window, navigator, document, require, process, module */ 14 | (function (app) { 15 | 'use strict'; 16 | var namespace = 'cuid', 17 | c = 0, 18 | blockSize = 4, 19 | base = 36, 20 | discreteValues = Math.pow(base, blockSize), 21 | 22 | pad = function pad(num, size) { 23 | var s = "000000000" + num; 24 | return s.substr(s.length-size); 25 | }, 26 | 27 | randomBlock = function randomBlock() { 28 | return pad((Math.random() * 29 | discreteValues << 0) 30 | .toString(base), blockSize); 31 | }, 32 | 33 | safeCounter = function () { 34 | c = (c < discreteValues) ? c : 0; 35 | c++; // this is not subliminal 36 | return c - 1; 37 | }, 38 | 39 | api = function cuid() { 40 | // Starting with a lowercase letter makes 41 | // it HTML element ID friendly. 42 | var letter = 'c', // hard-coded allows for sequential access 43 | 44 | // timestamp 45 | // warning: this exposes the exact date and time 46 | // that the uid was created. 47 | timestamp = (new Date().getTime()).toString(base), 48 | 49 | // Prevent same-machine collisions. 50 | counter, 51 | 52 | // A few chars to generate distinct ids for different 53 | // clients (so different computers are far less 54 | // likely to generate the same id) 55 | fingerprint = api.fingerprint(), 56 | 57 | // Grab some more chars from Math.random() 58 | random = randomBlock() + randomBlock(); 59 | 60 | counter = pad(safeCounter().toString(base), blockSize); 61 | 62 | return (letter + timestamp + counter + fingerprint + random); 63 | }; 64 | 65 | api.slug = function slug() { 66 | var date = new Date().getTime().toString(36), 67 | counter, 68 | print = api.fingerprint().slice(0,1) + 69 | api.fingerprint().slice(-1), 70 | random = randomBlock().slice(-2); 71 | 72 | counter = safeCounter().toString(36).slice(-4); 73 | 74 | return date.slice(-2) + 75 | counter + print + random; 76 | }; 77 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/cuid/src/node-fingerprint.js: -------------------------------------------------------------------------------- 1 | api.fingerprint = function nodePrint() { 2 | var os = require('os'), 3 | 4 | padding = 2, 5 | pid = pad((process.pid).toString(36), padding), 6 | hostname = os.hostname(), 7 | length = hostname.length, 8 | hostId = pad((hostname) 9 | .split('') 10 | .reduce(function (prev, char) { 11 | return +prev + char.charCodeAt(0); 12 | }, +length + 36) 13 | .toString(36), 14 | padding); 15 | return pid + hostId; 16 | }; 17 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/cuid/test/applitude-cuid-test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 |

QUnit Test Suite

8 |

9 |
10 |

11 |
    12 |
    13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/cuid/test/applitude-cuid-test.js: -------------------------------------------------------------------------------- 1 | /*global window, applitude, test, ok, cuid, equal, stop, start*/ 2 | (function () { 3 | 'use strict'; 4 | var collision = false; 5 | 6 | test('cuid()', function () { 7 | stop(); 8 | (function () { 9 | var ids = window.ids = {}, 10 | cuid = applitude.cuid, 11 | i, 12 | id; 13 | for (i = 0; i < 600000; i++) { 14 | id = cuid(); 15 | if (!ids[id]) { 16 | ids[id] = id; 17 | } else { 18 | collision = true; 19 | break; 20 | } 21 | } 22 | 23 | ok(typeof cuid() === 'string', 24 | '.cuid() should return a string'); 25 | 26 | ok(!collision, 27 | '.cuid() should generate unique ids on a single machine'); 28 | 29 | start(); 30 | 31 | }()); 32 | }); 33 | }()); 34 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/cuid/test/browser-cuid-test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
    7 |

    QUnit Test Suite

    8 |

    9 |
    10 |

    11 |
      12 |
      13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/cuid/test/browser-cuid-test.js: -------------------------------------------------------------------------------- 1 | /*global window, applitude, test, ok, cuid, equal, stop, start*/ 2 | (function () { 3 | 'use strict'; 4 | var collision = false; 5 | 6 | test('cuid()', function () { 7 | stop(); 8 | (function () { 9 | var ids = window.ids = {}, 10 | i, 11 | id; 12 | for (i = 0; i < 600000; i++) { 13 | id = cuid(); 14 | if (!ids[id]) { 15 | ids[id] = id; 16 | } else { 17 | collision = true; 18 | break; 19 | } 20 | } 21 | 22 | ok(typeof cuid() === 'string', 23 | '.cuid() should return a string'); 24 | 25 | ok(!collision, 26 | '.cuid() should generate unique ids on a single machine'); 27 | 28 | start(); 29 | 30 | }()); 31 | }); 32 | }()); 33 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/cuid/test/node-cuid-test.js: -------------------------------------------------------------------------------- 1 | var cuid = require('../dist/node-cuid.js'); 2 | 3 | var MAX = 1200000; 4 | var collisionTest = function collisionTest(fn) { 5 | var i = 0, 6 | id, 7 | ids = {}, 8 | pass = true; 9 | while (i < MAX) { 10 | id = fn(); 11 | if (!ids[id]) { 12 | ids[id] = id; 13 | } else { 14 | pass = false; 15 | console.log('Failed at ' + i + ' iterations.'); 16 | break; 17 | } 18 | i++; 19 | } 20 | return pass; 21 | }; 22 | 23 | exports.testcuid = function (test) { 24 | 25 | test.ok(typeof cuid() === 'string', 26 | '.cuid() should return a string.'); 27 | 28 | test.ok(collisionTest(cuid), 29 | 'ids should not collide.'); 30 | 31 | test.ok(collisionTest(cuid.slug), 32 | 'slugs should not collide.'); 33 | 34 | test.done(); 35 | 36 | }; 37 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/node_modules/cuid/test/testling.js: -------------------------------------------------------------------------------- 1 | var test = require('testling'); 2 | 3 | /** 4 | * cuid.js 5 | * Collision-resistant client-side UID generator safe 6 | * for element IDs and server-side lookups. 7 | * 8 | * Extracted from CLCTR 9 | * 10 | * Copyright (c) Eric Elliott 2012 11 | * MIT License 12 | */ 13 | 14 | /*global window, navigator, document */ 15 | var global = global || this, module = module || undefined, 16 | exports = module && module.exports || undefined; 17 | 18 | (function (app) { 19 | 'use strict'; 20 | var namespace = 'cuid', 21 | c = 0, 22 | globalCount = (function () { 23 | var i, 24 | count = 0; 25 | for (i in window) { 26 | count++; 27 | } 28 | return count; 29 | }()), 30 | 31 | pad = function pad(num, size) { 32 | var s = "000000000" + num; 33 | return s.substr(s.length-size); 34 | }, 35 | 36 | api = function cuid() { 37 | // Starting with a lowercase letter Makes 38 | // it HTML element ID friendly. 39 | var letter = 'c', // fixed = allows for sequential access 40 | 41 | // timestamp 42 | // warning: this exposes the exact date and time 43 | // that the uid was created. 44 | timestamp = (new Date().getTime()).toString(36), 45 | 46 | // Without this, 1 in 600,000 IDs collide. 47 | counter, 48 | 49 | // A few chars to generate distinct ids for different 50 | // browser / page combos (so different computers are far less 51 | // likely to generate the same id) 52 | fingerprint = pad((navigator.mimeTypes.length + 53 | navigator.userAgent.length).toString(36) + 54 | globalCount.toString(36), 4), 55 | 56 | // Grab some more chars from browser's .random() method 57 | random = pad((Math.random() * 58 | Math.pow(36, 4) << 0) 59 | .toString(36), 4); 60 | 61 | c = (c < 1679615) ? c : 0; 62 | counter = pad(c.toString(36), 4); 63 | 64 | c++; // this is not subliminal 65 | 66 | return (letter + timestamp + counter + fingerprint + random); 67 | }; 68 | 69 | if (app.register) { 70 | app.register(namespace, api); 71 | } else { 72 | app[namespace] = api; 73 | } 74 | 75 | }(global.applitude || (global.navigator && global) || exports)); 76 | 77 | test('cuid', function (t) { 78 | var i; 79 | for (i = 0; i < 10; i++) { 80 | t.log(cuid()); 81 | } 82 | t.end(); 83 | }); 84 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/node_modules/compilex/pyModule.js: -------------------------------------------------------------------------------- 1 | var exec = require('child_process').exec; 2 | var fs = require('fs'); 3 | var cuid = require('cuid'); 4 | var colors = require('colors'); 5 | 6 | exports.stats = false ; 7 | 8 | exports.compilePython = function (envData , code , fn){ 9 | 10 | var filename = cuid.slug(); 11 | path = './temp/'; 12 | 13 | fs.writeFile( path + filename +'.py' , code , function(err ){ 14 | if(exports.stats) 15 | { 16 | if(err) 17 | console.log('ERROR: '.red + err); 18 | else 19 | console.log('INFO: '.green + filename +'.py created'); 20 | } 21 | if(!err) 22 | { 23 | var command = 'python ' + path + filename +'.py'; 24 | exec( command , function ( error , stdout , stderr ){ 25 | if(error) 26 | { 27 | if(error.toString().indexOf('Error: stdout maxBuffer exceeded.') != -1) 28 | { 29 | var out = { error : 'Error: stdout maxBuffer exceeded. You might have initialized an infinite loop.' }; 30 | fn(out); 31 | } 32 | else 33 | { 34 | if(exports.stats) 35 | { 36 | console.log('INFO: '.green + filename + '.py contained an error while executing'); 37 | } 38 | var out = { error : stderr }; 39 | fn(out); 40 | } 41 | } 42 | else 43 | { 44 | if(exports.stats) 45 | { 46 | console.log('INFO: '.green + filename + '.py successfully executed !'); 47 | } 48 | var out = { output : stdout}; 49 | fn(out); 50 | } 51 | }); 52 | } 53 | }); 54 | } 55 | 56 | exports.compilePythonWithInput = function( envData , code , input , fn){ 57 | var filename = cuid.slug(); 58 | path = './temp/'; 59 | 60 | fs.writeFile( path + filename +'.py' , code , function(err ){ 61 | if(exports.stats) 62 | { 63 | if(err) 64 | console.log('ERROR: '.red + err); 65 | else 66 | console.log('INFO: '.green + filename +'.py created'); 67 | } 68 | if(!err) 69 | { 70 | 71 | fs.writeFile(path + filename + 'input.txt' , input , function(err){ 72 | if(exports.stats) 73 | { 74 | if(err) 75 | console.log('ERROR: '.red + err); 76 | else 77 | console.log('INFO: '.green + filename +'input.txt created'); 78 | } 79 | if(!err) 80 | { 81 | var command = 'python ' + path + filename +'.py < ' + path + filename +'input.txt ' ; 82 | exec( command , function ( error , stdout , stderr ){ 83 | if(error) 84 | { 85 | if(error.toString().indexOf('Error: stdout maxBuffer exceeded.') != -1) 86 | { 87 | var out = { error : 'Error: stdout maxBuffer exceeded. You might have initialized an infinite loop.' }; 88 | fn(out); 89 | } 90 | else 91 | { 92 | if(exports.stats) 93 | { 94 | console.log('INFO: '.green + filename + '.py contained an error while executing'); 95 | } 96 | var out = { error : stderr }; 97 | fn(out); 98 | } 99 | } 100 | else 101 | { 102 | if(exports.stats) 103 | { 104 | console.log('INFO: '.green + filename + '.py successfully executed !'); 105 | } 106 | var out = { output : stdout}; 107 | fn(out); 108 | } 109 | }); 110 | } 111 | }); 112 | } 113 | }); 114 | } 115 | -------------------------------------------------------------------------------- /examples/compilex-Demo1/server.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var path = require('path'); 3 | var app = express(); 4 | var bodyParser = require('body-parser'); 5 | app.use(bodyParser()); 6 | 7 | //compileX 8 | var compiler = require('compilex'); 9 | var option = {stats : true}; 10 | compiler.init(option); 11 | 12 | app.get('/' , function (req , res ) { 13 | 14 | res.sendfile( __dirname + "/index.html"); 15 | 16 | }); 17 | 18 | 19 | app.post('/compilecode' , function (req , res ) { 20 | 21 | var code = req.body.code; 22 | var input = req.body.input; 23 | var inputRadio = req.body.inputRadio; 24 | var lang = req.body.lang; 25 | if((lang === "C") || (lang === "C++")) 26 | { 27 | if(inputRadio === "true") 28 | { 29 | var envData = { OS : "windows" , cmd : "g++"}; 30 | compiler.compileCPPWithInput(envData , code ,input , function (data) { 31 | if(data.error) 32 | { 33 | res.send(data.error); 34 | } 35 | else 36 | { 37 | res.send(data.output); 38 | } 39 | }); 40 | } 41 | else 42 | { 43 | 44 | var envData = { OS : "windows" , cmd : "g++"}; 45 | compiler.compileCPP(envData , code , function (data) { 46 | if(data.error) 47 | { 48 | res.send(data.error); 49 | } 50 | else 51 | { 52 | res.send(data.output); 53 | } 54 | 55 | }); 56 | } 57 | } 58 | if(lang === "Java") 59 | { 60 | if(inputRadio === "true") 61 | { 62 | var envData = { OS : "windows" }; 63 | console.log(code); 64 | compiler.compileJavaWithInput( envData , code , function(data){ 65 | res.send(data); 66 | }); 67 | } 68 | else 69 | { 70 | var envData = { OS : "windows" }; 71 | console.log(code); 72 | compiler.compileJavaWithInput( envData , code , input , function(data){ 73 | res.send(data); 74 | }); 75 | 76 | } 77 | 78 | } 79 | if( lang === "Python") 80 | { 81 | if(inputRadio === "true") 82 | { 83 | var envData = { OS : "windows"}; 84 | compiler.compilePythonWithInput(envData , code , input , function(data){ 85 | res.send(data); 86 | }); 87 | } 88 | else 89 | { 90 | var envData = { OS : "windows"}; 91 | compiler.compilePython(envData , code , function(data){ 92 | res.send(data); 93 | }); 94 | } 95 | } 96 | if( lang === "CS") 97 | { 98 | if(inputRadio === "true") 99 | { 100 | var envData = { OS : "windows"}; 101 | compiler.compileCSWithInput(envData , code , input , function(data){ 102 | res.send(data); 103 | }); 104 | } 105 | else 106 | { 107 | var envData = { OS : "windows"}; 108 | compiler.compileCS(envData , code , function(data){ 109 | res.send(data); 110 | }); 111 | } 112 | 113 | } 114 | if( lang === "VB") 115 | { 116 | if(inputRadio === "true") 117 | { 118 | var envData = { OS : "windows"}; 119 | compiler.compileVBWithInput(envData , code , input , function(data){ 120 | res.send(data); 121 | }); 122 | } 123 | else 124 | { 125 | var envData = { OS : "windows"}; 126 | compiler.compileVB(envData , code , function(data){ 127 | res.send(data); 128 | }); 129 | } 130 | 131 | } 132 | 133 | }); 134 | 135 | app.get('/fullStat' , function(req , res ){ 136 | compiler.fullStat(function(data){ 137 | res.send(data); 138 | }); 139 | }); 140 | 141 | app.listen(8080); 142 | -------------------------------------------------------------------------------- /node_modules/colors/MIT-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 2 | 3 | Marak Squires 4 | Alexis Sellier (cloudhead) 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. -------------------------------------------------------------------------------- /node_modules/colors/ReadMe.md: -------------------------------------------------------------------------------- 1 | # colors.js - get color and style in your node.js console ( and browser ) like what 2 | 3 | 4 | 5 | 6 | ## Installation 7 | 8 | npm install colors 9 | 10 | ## colors and styles! 11 | 12 | - bold 13 | - italic 14 | - underline 15 | - inverse 16 | - yellow 17 | - cyan 18 | - white 19 | - magenta 20 | - green 21 | - red 22 | - grey 23 | - blue 24 | - rainbow 25 | - zebra 26 | - random 27 | 28 | ## Usage 29 | 30 | ``` js 31 | var colors = require('./colors'); 32 | 33 | console.log('hello'.green); // outputs green text 34 | console.log('i like cake and pies'.underline.red) // outputs red underlined text 35 | console.log('inverse the color'.inverse); // inverses the color 36 | console.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces) 37 | ``` 38 | 39 | # Creating Custom themes 40 | 41 | ```js 42 | 43 | var colors = require('colors'); 44 | 45 | colors.setTheme({ 46 | silly: 'rainbow', 47 | input: 'grey', 48 | verbose: 'cyan', 49 | prompt: 'grey', 50 | info: 'green', 51 | data: 'grey', 52 | help: 'cyan', 53 | warn: 'yellow', 54 | debug: 'blue', 55 | error: 'red' 56 | }); 57 | 58 | // outputs red text 59 | console.log("this is an error".error); 60 | 61 | // outputs yellow text 62 | console.log("this is a warning".warn); 63 | ``` 64 | 65 | 66 | ### Contributors 67 | 68 | Marak (Marak Squires) 69 | Alexis Sellier (cloudhead) 70 | mmalecki (Maciej Małecki) 71 | nicoreed (Nico Reed) 72 | morganrallen (Morgan Allen) 73 | JustinCampbell (Justin Campbell) 74 | ded (Dustin Diaz) 75 | 76 | 77 | #### , Marak Squires , Justin Campbell, Dustin Diaz (@ded) 78 | -------------------------------------------------------------------------------- /node_modules/colors/example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Colors Example 6 | 7 | 8 | 9 | 75 | 76 | -------------------------------------------------------------------------------- /node_modules/colors/example.js: -------------------------------------------------------------------------------- 1 | var colors = require('./colors'); 2 | 3 | //colors.mode = "browser"; 4 | 5 | var test = colors.red("hopefully colorless output"); 6 | console.log('Rainbows are fun!'.rainbow); 7 | console.log('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported 8 | console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported 9 | //console.log('zalgo time!'.zalgo); 10 | console.log(test.stripColors); 11 | console.log("a".grey + " b".black); 12 | console.log("Zebras are so fun!".zebra); 13 | console.log('background color attack!'.black.whiteBG) 14 | 15 | // 16 | // Remark: .strikethrough may not work with Mac OS Terminal App 17 | // 18 | console.log("This is " + "not".strikethrough + " fun."); 19 | console.log(colors.rainbow('Rainbows are fun!')); 20 | console.log(colors.italic('So ') + colors.underline('are') + colors.bold(' styles! ') + colors.inverse('inverse')); // styles not widely supported 21 | console.log(colors.bold(colors.italic(colors.underline(colors.red('Chains are also cool.'))))); // styles not widely supported 22 | //console.log(colors.zalgo('zalgo time!')); 23 | console.log(colors.stripColors(test)); 24 | console.log(colors.grey("a") + colors.black(" b")); 25 | 26 | colors.addSequencer("america", function(letter, i, exploded) { 27 | if(letter === " ") return letter; 28 | switch(i%3) { 29 | case 0: return letter.red; 30 | case 1: return letter.white; 31 | case 2: return letter.blue; 32 | } 33 | }); 34 | 35 | colors.addSequencer("random", (function() { 36 | var available = ['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta']; 37 | 38 | return function(letter, i, exploded) { 39 | return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]]; 40 | }; 41 | })()); 42 | 43 | console.log("AMERICA! F--K YEAH!".america); 44 | console.log("So apparently I've been to Mars, with all the little green men. But you know, I don't recall.".random); 45 | 46 | // 47 | // Custom themes 48 | // 49 | 50 | // Load theme with JSON literal 51 | colors.setTheme({ 52 | silly: 'rainbow', 53 | input: 'grey', 54 | verbose: 'cyan', 55 | prompt: 'grey', 56 | info: 'green', 57 | data: 'grey', 58 | help: 'cyan', 59 | warn: 'yellow', 60 | debug: 'blue', 61 | error: 'red' 62 | }); 63 | 64 | // outputs red text 65 | console.log("this is an error".error); 66 | 67 | // outputs yellow text 68 | console.log("this is a warning".warn); 69 | 70 | // outputs grey text 71 | console.log("this is an input".input); 72 | 73 | // Load a theme from file 74 | colors.setTheme('./themes/winston-dark.js'); 75 | 76 | console.log("this is an input".input); 77 | 78 | -------------------------------------------------------------------------------- /node_modules/colors/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "colors", 3 | "description": "get colors in your node.js console like what", 4 | "version": "0.6.2", 5 | "author": { 6 | "name": "Marak Squires" 7 | }, 8 | "homepage": "https://github.com/Marak/colors.js", 9 | "bugs": { 10 | "url": "https://github.com/Marak/colors.js/issues" 11 | }, 12 | "keywords": [ 13 | "ansi", 14 | "terminal", 15 | "colors" 16 | ], 17 | "repository": { 18 | "type": "git", 19 | "url": "http://github.com/Marak/colors.js.git" 20 | }, 21 | "engines": { 22 | "node": ">=0.1.90" 23 | }, 24 | "main": "colors", 25 | "readme": "# colors.js - get color and style in your node.js console ( and browser ) like what\n\n\n\n\n## Installation\n\n npm install colors\n\n## colors and styles!\n\n- bold\n- italic\n- underline\n- inverse\n- yellow\n- cyan\n- white\n- magenta\n- green\n- red\n- grey\n- blue\n- rainbow\n- zebra\n- random\n\n## Usage\n\n``` js\nvar colors = require('./colors');\n\nconsole.log('hello'.green); // outputs green text\nconsole.log('i like cake and pies'.underline.red) // outputs red underlined text\nconsole.log('inverse the color'.inverse); // inverses the color\nconsole.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces)\n```\n\n# Creating Custom themes\n\n```js\n\nvar colors = require('colors');\n\ncolors.setTheme({\n silly: 'rainbow',\n input: 'grey',\n verbose: 'cyan',\n prompt: 'grey',\n info: 'green',\n data: 'grey',\n help: 'cyan',\n warn: 'yellow',\n debug: 'blue',\n error: 'red'\n});\n\n// outputs red text\nconsole.log(\"this is an error\".error);\n\n// outputs yellow text\nconsole.log(\"this is a warning\".warn);\n```\n\n\n### Contributors \n\nMarak (Marak Squires)\nAlexis Sellier (cloudhead)\nmmalecki (Maciej Małecki)\nnicoreed (Nico Reed)\nmorganrallen (Morgan Allen)\nJustinCampbell (Justin Campbell)\nded (Dustin Diaz)\n\n\n#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded)\n", 26 | "readmeFilename": "ReadMe.md", 27 | "_id": "colors@0.6.2", 28 | "_from": "colors@0.6.2", 29 | "dist": { 30 | "shasum": "08d03c59c28382ca5febf6a178807accd8b2fdbe" 31 | }, 32 | "_resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz" 33 | } 34 | -------------------------------------------------------------------------------- /node_modules/colors/test.js: -------------------------------------------------------------------------------- 1 | var assert = require('assert'), 2 | colors = require('./colors'); 3 | 4 | var s = 'string'; 5 | 6 | function a(s, code) { 7 | return '\x1B[' + code.toString() + 'm' + s + '\x1B[39m'; 8 | } 9 | 10 | function aE(s, color, code) { 11 | assert.equal(s[color], a(s, code)); 12 | assert.equal(colors[color](s), a(s, code)); 13 | assert.equal(s[color], colors[color](s)); 14 | assert.equal(s[color].stripColors, s); 15 | assert.equal(s[color].stripColors, colors.stripColors(s)); 16 | } 17 | 18 | function h(s, color) { 19 | return '' + s + ''; 20 | } 21 | 22 | var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow']; 23 | var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']); 24 | 25 | colors.mode = 'console'; 26 | assert.equal(s.bold, '\x1B[1m' + s + '\x1B[22m'); 27 | assert.equal(s.italic, '\x1B[3m' + s + '\x1B[23m'); 28 | assert.equal(s.underline, '\x1B[4m' + s + '\x1B[24m'); 29 | assert.equal(s.strikethrough, '\x1B[9m' + s + '\x1B[29m'); 30 | assert.equal(s.inverse, '\x1B[7m' + s + '\x1B[27m'); 31 | assert.ok(s.rainbow); 32 | aE(s, 'white', 37); 33 | aE(s, 'grey', 90); 34 | aE(s, 'black', 30); 35 | aE(s, 'blue', 34); 36 | aE(s, 'cyan', 36); 37 | aE(s, 'green', 32); 38 | aE(s, 'magenta', 35); 39 | aE(s, 'red', 31); 40 | aE(s, 'yellow', 33); 41 | assert.equal(s, 'string'); 42 | 43 | colors.setTheme({error:'red'}); 44 | 45 | assert.equal(typeof("astring".red),'string'); 46 | assert.equal(typeof("astring".error),'string'); 47 | 48 | colors.mode = 'browser'; 49 | assert.equal(s.bold, '' + s + ''); 50 | assert.equal(s.italic, '' + s + ''); 51 | assert.equal(s.underline, '' + s + ''); 52 | assert.equal(s.strikethrough, '' + s + ''); 53 | assert.equal(s.inverse, '' + s + ''); 54 | assert.ok(s.rainbow); 55 | stylesColors.forEach(function (color) { 56 | assert.equal(s[color], h(s, color)); 57 | assert.equal(colors[color](s), h(s, color)); 58 | }); 59 | 60 | assert.equal(typeof("astring".red),'string'); 61 | assert.equal(typeof("astring".error),'string'); 62 | 63 | colors.mode = 'none'; 64 | stylesAll.forEach(function (style) { 65 | assert.equal(s[style], s); 66 | assert.equal(colors[style](s), s); 67 | }); 68 | 69 | assert.equal(typeof("astring".red),'string'); 70 | assert.equal(typeof("astring".error),'string'); 71 | -------------------------------------------------------------------------------- /node_modules/colors/themes/winston-dark.js: -------------------------------------------------------------------------------- 1 | module['exports'] = { 2 | silly: 'rainbow', 3 | input: 'black', 4 | verbose: 'cyan', 5 | prompt: 'grey', 6 | info: 'green', 7 | data: 'grey', 8 | help: 'cyan', 9 | warn: 'yellow', 10 | debug: 'blue', 11 | error: 'red' 12 | }; -------------------------------------------------------------------------------- /node_modules/colors/themes/winston-light.js: -------------------------------------------------------------------------------- 1 | module['exports'] = { 2 | silly: 'rainbow', 3 | input: 'grey', 4 | verbose: 'cyan', 5 | prompt: 'grey', 6 | info: 'green', 7 | data: 'grey', 8 | help: 'cyan', 9 | warn: 'yellow', 10 | debug: 'blue', 11 | error: 'red' 12 | }; -------------------------------------------------------------------------------- /node_modules/cuid/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build -------------------------------------------------------------------------------- /node_modules/cuid/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | -------------------------------------------------------------------------------- /node_modules/cuid/LICENSE: -------------------------------------------------------------------------------- 1 | cuid is covered by The MIT License: 2 | 3 | Copyright (c) 2012 Eric Elliott 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /node_modules/cuid/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cuid", 3 | "repo": "dilvie/cuid", 4 | "description": "Collision-resistant ids optimized for horizontal scaling and performance", 5 | "version": "1.2.2", 6 | "keywords": [ 7 | "uid", 8 | "unique id", 9 | "guid", 10 | "uuid" 11 | ], 12 | "dependencies": {}, 13 | "development": {}, 14 | "license": "MIT", 15 | "main": "dist/browser-cuid.js", 16 | "scripts": [ 17 | "dist/browser-cuid.js" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /node_modules/cuid/grunt.js: -------------------------------------------------------------------------------- 1 | /*global module*/ 2 | module.exports = function(grunt) { 3 | 'use strict'; 4 | grunt.initConfig({ 5 | pkg: '', 6 | lint: { 7 | all: ['./grunt.js', './dist/*.js', './test/test.js'] 8 | }, 9 | jshint: { 10 | options: { 11 | curly: true, 12 | eqeqeq: true, 13 | immed: true, 14 | latedef: true, 15 | newcap: true, 16 | nonew: true, 17 | noarg: true, 18 | sub: true, 19 | undef: true, 20 | unused: true, 21 | eqnull: true, 22 | browser: true, 23 | strict: true, 24 | boss: false 25 | } 26 | }, 27 | concat: { 28 | applitude: { 29 | src: ['node_modules/applitude/dist/applitude.bundle.js'], 30 | dest: 'lib/applitude.bundle.js' 31 | }, 32 | browser: { 33 | src: ['src/head.js', 'src/browser-fingerprint.js', 'src/footer.js'], 34 | dest: 'dist/browser-cuid.js' 35 | }, 36 | node: { 37 | src: ['src/head.js', 'src/node-fingerprint.js', 'src/footer.js'], 38 | dest: 'dist/node-cuid.js' 39 | } 40 | }, 41 | qunit: { 42 | applitude: ['test/applitude-cuid-test.html'], 43 | browser: ['test/browser-cuid-test.html'] 44 | }, 45 | test: { 46 | "node-cuid": ['test/node-cuid-test.js'] 47 | } 48 | }); 49 | grunt.registerTask('testall', 'qunit test'); 50 | grunt.registerTask('default', 'concat lint'); 51 | grunt.registerTask('install', 'concat'); 52 | }; 53 | -------------------------------------------------------------------------------- /node_modules/cuid/src/browser-fingerprint.js: -------------------------------------------------------------------------------- 1 | api.globalCount = function globalCount() { 2 | // We want to cache the results of this 3 | var cache = (function calc() { 4 | var i, 5 | count = 0; 6 | 7 | for (i in window) { 8 | count++; 9 | } 10 | 11 | return count; 12 | }()); 13 | 14 | api.globalCount = function () { return cache; }; 15 | return cache; 16 | }; 17 | 18 | api.fingerprint = function browserPrint() { 19 | return pad((navigator.mimeTypes.length + 20 | navigator.userAgent.length).toString(36) + 21 | api.globalCount().toString(36), 4); 22 | }; -------------------------------------------------------------------------------- /node_modules/cuid/src/footer.js: -------------------------------------------------------------------------------- 1 | 2 | // don't change anything from here down. 3 | if (app.register) { 4 | app.register(namespace, api); 5 | } else if (typeof module !== 'undefined') { 6 | module.exports = api; 7 | } else { 8 | app[namespace] = api; 9 | } 10 | 11 | }(this.applitude || this)); 12 | -------------------------------------------------------------------------------- /node_modules/cuid/src/head.js: -------------------------------------------------------------------------------- 1 | /** 2 | * cuid.js 3 | * Collision-resistant UID generator for browsers and node. 4 | * Sequential for fast db lookups and recency sorting. 5 | * Safe for element IDs and server-side lookups. 6 | * 7 | * Extracted from CLCTR 8 | * 9 | * Copyright (c) Eric Elliott 2012 10 | * MIT License 11 | */ 12 | 13 | /*global window, navigator, document, require, process, module */ 14 | (function (app) { 15 | 'use strict'; 16 | var namespace = 'cuid', 17 | c = 0, 18 | blockSize = 4, 19 | base = 36, 20 | discreteValues = Math.pow(base, blockSize), 21 | 22 | pad = function pad(num, size) { 23 | var s = "000000000" + num; 24 | return s.substr(s.length-size); 25 | }, 26 | 27 | randomBlock = function randomBlock() { 28 | return pad((Math.random() * 29 | discreteValues << 0) 30 | .toString(base), blockSize); 31 | }, 32 | 33 | safeCounter = function () { 34 | c = (c < discreteValues) ? c : 0; 35 | c++; // this is not subliminal 36 | return c - 1; 37 | }, 38 | 39 | api = function cuid() { 40 | // Starting with a lowercase letter makes 41 | // it HTML element ID friendly. 42 | var letter = 'c', // hard-coded allows for sequential access 43 | 44 | // timestamp 45 | // warning: this exposes the exact date and time 46 | // that the uid was created. 47 | timestamp = (new Date().getTime()).toString(base), 48 | 49 | // Prevent same-machine collisions. 50 | counter, 51 | 52 | // A few chars to generate distinct ids for different 53 | // clients (so different computers are far less 54 | // likely to generate the same id) 55 | fingerprint = api.fingerprint(), 56 | 57 | // Grab some more chars from Math.random() 58 | random = randomBlock() + randomBlock(); 59 | 60 | counter = pad(safeCounter().toString(base), blockSize); 61 | 62 | return (letter + timestamp + counter + fingerprint + random); 63 | }; 64 | 65 | api.slug = function slug() { 66 | var date = new Date().getTime().toString(36), 67 | counter, 68 | print = api.fingerprint().slice(0,1) + 69 | api.fingerprint().slice(-1), 70 | random = randomBlock().slice(-2); 71 | 72 | counter = safeCounter().toString(36).slice(-4); 73 | 74 | return date.slice(-2) + 75 | counter + print + random; 76 | }; 77 | -------------------------------------------------------------------------------- /node_modules/cuid/src/node-fingerprint.js: -------------------------------------------------------------------------------- 1 | api.fingerprint = function nodePrint() { 2 | var os = require('os'), 3 | 4 | padding = 2, 5 | pid = pad((process.pid).toString(36), padding), 6 | hostname = os.hostname(), 7 | length = hostname.length, 8 | hostId = pad((hostname) 9 | .split('') 10 | .reduce(function (prev, char) { 11 | return +prev + char.charCodeAt(0); 12 | }, +length + 36) 13 | .toString(36), 14 | padding); 15 | return pid + hostId; 16 | }; 17 | -------------------------------------------------------------------------------- /node_modules/cuid/test/applitude-cuid-test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
      7 |

      QUnit Test Suite

      8 |

      9 |
      10 |

      11 |
        12 |
        13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /node_modules/cuid/test/applitude-cuid-test.js: -------------------------------------------------------------------------------- 1 | /*global window, applitude, test, ok, cuid, equal, stop, start*/ 2 | (function () { 3 | 'use strict'; 4 | var collision = false; 5 | 6 | test('cuid()', function () { 7 | stop(); 8 | (function () { 9 | var ids = window.ids = {}, 10 | cuid = applitude.cuid, 11 | i, 12 | id; 13 | for (i = 0; i < 600000; i++) { 14 | id = cuid(); 15 | if (!ids[id]) { 16 | ids[id] = id; 17 | } else { 18 | collision = true; 19 | break; 20 | } 21 | } 22 | 23 | ok(typeof cuid() === 'string', 24 | '.cuid() should return a string'); 25 | 26 | ok(!collision, 27 | '.cuid() should generate unique ids on a single machine'); 28 | 29 | start(); 30 | 31 | }()); 32 | }); 33 | }()); 34 | -------------------------------------------------------------------------------- /node_modules/cuid/test/browser-cuid-test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
        7 |

        QUnit Test Suite

        8 |

        9 |
        10 |

        11 |
          12 |
          13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /node_modules/cuid/test/browser-cuid-test.js: -------------------------------------------------------------------------------- 1 | /*global window, applitude, test, ok, cuid, equal, stop, start*/ 2 | (function () { 3 | 'use strict'; 4 | var collision = false; 5 | 6 | test('cuid()', function () { 7 | stop(); 8 | (function () { 9 | var ids = window.ids = {}, 10 | i, 11 | id; 12 | for (i = 0; i < 600000; i++) { 13 | id = cuid(); 14 | if (!ids[id]) { 15 | ids[id] = id; 16 | } else { 17 | collision = true; 18 | break; 19 | } 20 | } 21 | 22 | ok(typeof cuid() === 'string', 23 | '.cuid() should return a string'); 24 | 25 | ok(!collision, 26 | '.cuid() should generate unique ids on a single machine'); 27 | 28 | start(); 29 | 30 | }()); 31 | }); 32 | }()); 33 | -------------------------------------------------------------------------------- /node_modules/cuid/test/node-cuid-test.js: -------------------------------------------------------------------------------- 1 | var cuid = require('../dist/node-cuid.js'); 2 | 3 | var MAX = 1200000; 4 | var collisionTest = function collisionTest(fn) { 5 | var i = 0, 6 | id, 7 | ids = {}, 8 | pass = true; 9 | while (i < MAX) { 10 | id = fn(); 11 | if (!ids[id]) { 12 | ids[id] = id; 13 | } else { 14 | pass = false; 15 | console.log('Failed at ' + i + ' iterations.'); 16 | break; 17 | } 18 | i++; 19 | } 20 | return pass; 21 | }; 22 | 23 | exports.testcuid = function (test) { 24 | 25 | test.ok(typeof cuid() === 'string', 26 | '.cuid() should return a string.'); 27 | 28 | test.ok(collisionTest(cuid), 29 | 'ids should not collide.'); 30 | 31 | test.ok(collisionTest(cuid.slug), 32 | 'slugs should not collide.'); 33 | 34 | test.done(); 35 | 36 | }; 37 | -------------------------------------------------------------------------------- /node_modules/cuid/test/testling.js: -------------------------------------------------------------------------------- 1 | var test = require('testling'); 2 | 3 | /** 4 | * cuid.js 5 | * Collision-resistant client-side UID generator safe 6 | * for element IDs and server-side lookups. 7 | * 8 | * Extracted from CLCTR 9 | * 10 | * Copyright (c) Eric Elliott 2012 11 | * MIT License 12 | */ 13 | 14 | /*global window, navigator, document */ 15 | var global = global || this, module = module || undefined, 16 | exports = module && module.exports || undefined; 17 | 18 | (function (app) { 19 | 'use strict'; 20 | var namespace = 'cuid', 21 | c = 0, 22 | globalCount = (function () { 23 | var i, 24 | count = 0; 25 | for (i in window) { 26 | count++; 27 | } 28 | return count; 29 | }()), 30 | 31 | pad = function pad(num, size) { 32 | var s = "000000000" + num; 33 | return s.substr(s.length-size); 34 | }, 35 | 36 | api = function cuid() { 37 | // Starting with a lowercase letter Makes 38 | // it HTML element ID friendly. 39 | var letter = 'c', // fixed = allows for sequential access 40 | 41 | // timestamp 42 | // warning: this exposes the exact date and time 43 | // that the uid was created. 44 | timestamp = (new Date().getTime()).toString(36), 45 | 46 | // Without this, 1 in 600,000 IDs collide. 47 | counter, 48 | 49 | // A few chars to generate distinct ids for different 50 | // browser / page combos (so different computers are far less 51 | // likely to generate the same id) 52 | fingerprint = pad((navigator.mimeTypes.length + 53 | navigator.userAgent.length).toString(36) + 54 | globalCount.toString(36), 4), 55 | 56 | // Grab some more chars from browser's .random() method 57 | random = pad((Math.random() * 58 | Math.pow(36, 4) << 0) 59 | .toString(36), 4); 60 | 61 | c = (c < 1679615) ? c : 0; 62 | counter = pad(c.toString(36), 4); 63 | 64 | c++; // this is not subliminal 65 | 66 | return (letter + timestamp + counter + fingerprint + random); 67 | }; 68 | 69 | if (app.register) { 70 | app.register(namespace, api); 71 | } else { 72 | app[namespace] = api; 73 | } 74 | 75 | }(global.applitude || (global.navigator && global) || exports)); 76 | 77 | test('cuid', function (t) { 78 | var i; 79 | for (i = 0; i < 10; i++) { 80 | t.log(cuid()); 81 | } 82 | t.end(); 83 | }); 84 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "compilex", 3 | "version": "0.7.4", 4 | "description": "compilex is a node.js library which is used to build online code editor/compiler websites and webservices.", 5 | "main": "compilex.js", 6 | "dependencies": { 7 | "cuid": "~1.2.4", 8 | "colors": "~0.6.2" 9 | }, 10 | "devDependencies": {}, 11 | "scripts": { 12 | "test": "make test" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/scriptnull/compilex.git" 17 | }, 18 | "keywords": [ 19 | "compiler", 20 | "compilex", 21 | "c", 22 | "c++", 23 | "java", 24 | "python", 25 | "c#", 26 | "vb", 27 | "gcc", 28 | "javac", 29 | "csc", 30 | "vbc" 31 | ], 32 | "author": "Vishnu Bharathi (https://twitter.com/scriptnull)", 33 | "license": "MIT", 34 | "bugs": { 35 | "url": "https://github.com/scriptnull/compilex/issues" 36 | }, 37 | "homepage": "https://github.com/scriptnull/compilex" 38 | } 39 | -------------------------------------------------------------------------------- /pyModule.js: -------------------------------------------------------------------------------- 1 | var exec = require('child_process').exec; 2 | var fs = require('fs'); 3 | var cuid = require('cuid'); 4 | var colors = require('colors'); 5 | 6 | exports.stats = false ; 7 | 8 | exports.compilePython = function (envData , code , fn){ 9 | 10 | var filename = cuid.slug(); 11 | path = './temp/'; 12 | 13 | fs.writeFile( path + filename +'.py' , code , function(err ){ 14 | if(exports.stats) 15 | { 16 | if(err) 17 | console.log('ERROR: '.red + err); 18 | else 19 | console.log('INFO: '.green + filename +'.py created'); 20 | } 21 | if(!err) 22 | { 23 | var command = 'python ' + path + filename +'.py'; 24 | exec( command , function ( error , stdout , stderr ){ 25 | if(error) 26 | { 27 | if(error.toString().indexOf('Error: stdout maxBuffer exceeded.') != -1) 28 | { 29 | var out = { error : 'Error: stdout maxBuffer exceeded. You might have initialized an infinite loop.' }; 30 | fn(out); 31 | } 32 | else 33 | { 34 | if(exports.stats) 35 | { 36 | console.log('INFO: '.green + filename + '.py contained an error while executing'); 37 | } 38 | var out = { error : stderr }; 39 | fn(out); 40 | } 41 | } 42 | else 43 | { 44 | if(exports.stats) 45 | { 46 | console.log('INFO: '.green + filename + '.py successfully executed !'); 47 | } 48 | var out = { output : stdout}; 49 | fn(out); 50 | } 51 | }); 52 | } 53 | }); 54 | } 55 | 56 | exports.compilePythonWithInput = function( envData , code , input , fn){ 57 | var filename = cuid.slug(); 58 | path = './temp/'; 59 | 60 | fs.writeFile( path + filename +'.py' , code , function(err ){ 61 | if(exports.stats) 62 | { 63 | if(err) 64 | console.log('ERROR: '.red + err); 65 | else 66 | console.log('INFO: '.green + filename +'.py created'); 67 | } 68 | if(!err) 69 | { 70 | 71 | fs.writeFile(path + filename + 'input.txt' , input , function(err){ 72 | if(exports.stats) 73 | { 74 | if(err) 75 | console.log('ERROR: '.red + err); 76 | else 77 | console.log('INFO: '.green + filename +'input.txt created'); 78 | } 79 | if(!err) 80 | { 81 | var command = 'python ' + path + filename +'.py < ' + path + filename +'input.txt ' ; 82 | exec( command , function ( error , stdout , stderr ){ 83 | if(error) 84 | { 85 | if(error.toString().indexOf('Error: stdout maxBuffer exceeded.') != -1) 86 | { 87 | var out = { error : 'Error: stdout maxBuffer exceeded. You might have initialized an infinite loop.' }; 88 | fn(out); 89 | } 90 | else 91 | { 92 | if(exports.stats) 93 | { 94 | console.log('INFO: '.green + filename + '.py contained an error while executing'); 95 | } 96 | var out = { error : stderr }; 97 | fn(out); 98 | } 99 | } 100 | else 101 | { 102 | if(exports.stats) 103 | { 104 | console.log('INFO: '.green + filename + '.py successfully executed !'); 105 | } 106 | var out = { output : stdout}; 107 | fn(out); 108 | } 109 | }); 110 | } 111 | }); 112 | } 113 | }); 114 | } 115 | --------------------------------------------------------------------------------