Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nodejs Meetup Feed Back #12

Open
pcimino opened this issue Mar 12, 2014 · 3 comments
Open

Nodejs Meetup Feed Back #12

pcimino opened this issue Mar 12, 2014 · 3 comments

Comments

@pcimino
Copy link
Owner

pcimino commented Mar 12, 2014

Had a code roast, here are some of the suggetions I want to work on next....

  • Modularize Node methods, request and response shouldn't be passed all the way into functions, separate functional code from the REST API
  • In the package.json, don't use latest for versions.
    • To simplify version management: npm list (npm list -g for global installed). using tilde (e.g. "~1.01") allows updates for buig fixes but not major versions.
    • Externalize npm module versions: One of the people from MeetMe described briefly how to put the version numbers in a file independent of the package.json, I need to reach out and get a better explanation from her
    • Look into npm shrinkwrap for managing package dependencies
    • Look into npm outdated
  • IN routes.js and in the server for the ENyo project, replace the multi lines for the public GET with fstream.pipe(res)
  • In routes.js, instead of passing all the instantiated singletons, create a module which exports an instance that can then be pulled into where it's needed instead of passing via signature
@pcimino
Copy link
Owner Author

pcimino commented Mar 20, 2014

Tackled the last bullet today. Most of the modules (config, auth) can now be pulled in using require instead of passed as method args.

@pcimino
Copy link
Owner Author

pcimino commented Mar 21, 2014

Last night I looked at modularizing the methods. The comment was: Avoid passing the request/response objects all the way down the chain.

The problem I'm having is each call is a nested chain of callbacks and promises. So breaking out the functionality into methods doesn't work since almost everything is asynchronous. Putting them in promise chains will create many extra methods, And I still have to pass around the response object. So not sure how to tackle this yet.

@pcimino
Copy link
Owner Author

pcimino commented Mar 22, 2014

Cleaned up the get() to use the stream pipe instead of multiple code blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant