Skip to content
Myr

refactored express(1) package.json generation

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parent e46431e · Browse files · 1 file+11 added−11 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+11 added−11 removed

  • other:+11 added−11 removed

1 file+11 added−11 removed

modified:bin/express+11 added-11 removed
292 unmodified lines
293 // Template support294 app = app.replace(':TEMPLATE', program.template);295296 // package.json297 var json = '{' + eol;298 json += ' "name": "application-name"' + eol;299 json += ' , "version": "0.0.1"' + eol;300 json += ' , "private": true' + eol;301 json += ' , "dependencies": {' + eol;302 json += ' "express": "' + express.version + '"' + eol;303 if (program.css) json += ' , "' + program.css + '": "*"' + eol;304 if (program.template) json += ' , "' + program.template + '": "*"' + eol;305 json += ' }' + eol;306 json += '}';297 var pkg = {298 name: 'application-name'299 , version: '0.0.1'300 , private: true301 , dependencies: {302 express: express.version303 }304 }305306 if (program.css) pkg.dependencies[program.css] = '*';307 if (program.template) pkg.dependencies[program.template] = '*';308309 write(path + '/package.json', json);309 write(path + '/package.json', JSON.stringify(pkg, null, 2));310 write(path + '/app.js', app);311 });312}313
51 unmodified lines