Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7818549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:36:43+00:00 2026-06-02T06:36:43+00:00

I’m working on my first Cloud Foundry project (…and first Node.js project, and first

  • 0

I’m working on my first Cloud Foundry project (…and first Node.js project, and first MongoDB project, and first “express” project, etc. etc…)

On day one I found this question, and used the answer as a jumping off point for the organization of my github repository:

Folder structure for a Node.js project

There is a /node_modules directory which is not checked in. Rather it is created automatically by npm install based on the specification in a package.json file. Okay, good…I made that file.

(Note: During a vmc push, it seems there is no examination of the package.json file by the pushed-to server. It seems to merely copy over the node_modules directory and does nothing if it doesn’t exist…so it’s necessary to do the npm install on your client and THEN push.)

I’ve got some basics working in my application, and am now at the point where I’d like to begin laying down testing and building infrastructure. For instance: I’d like a build process that will run linting on all my JavaScript. There’s a continuous integration library called ready.js that looks like an up-to-date build tool…

But something feels wrong about being in my project’s directory and doing npm install ready.js. This means that more stuff will be going into the /node_modules directory and uploaded to the cloud, when it’s not intended to run on the cloud. By the same token: if I have a build process that’s doing minification of resources (or whatever) then I don’t want the source being deployed with vmc push either.

I know all this is new…but is there a convention to dump the targets into a build directory and push from there? Or does everyone push from what is effectively the github root, and just push all the builds and tests along as well? Any tips are welcome…methods to use, methods to avoid…

UPDATE: I found an application boilerplate for using express and Node.js (as well as several other common modules), which does its “build process” inside the server code’s javascript…for better or worse:

https://github.com/mape/node-express-boilerplate

I also found this, and it seems like combining the term “boilerplate” with names of modules you’d like to see incorporated into the structure is a good search strategy for finding the sort of thing I am looking for:

https://github.com/swbiggart/node-express-requirejs-backbone

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T06:36:45+00:00Added an answer on June 2, 2026 at 6:36 am

    npm allows you to specify devDependencies, you may want to see this article.

    You could add all of your dev/test environment dependencies under devDependencies and all production-related modules under dependencies. Then, you could add a script to push to the cloud.

    I’m not familiar with Cloud Foundry or the vmc push workflow. But, you could add a custom script to the scripts object in package.json which installs dev-environment modules, runs your tests, cleans the npm cache, then installs production-only modules and pushes your code and only those modules to the cloud.

    edit

    I’m not sure you can use these if not pushing to the npm repository, but they are useful as an example (I guess…) Alternatively, you could automate the workflow I described above in a shell script or node script.

    /edit

    You could hook into any of the scripts available… (see man npm-scripts for more info):

       preinstall
              Run BEFORE the package is installed
    
       install, postinstall
              Run AFTER the package is installed.
    
       preuninstall, uninstall
              Run BEFORE the package is uninstalled.
    
       postuninstall
              Run AFTER the package is uninstalled.
    
       preupdate
              Run BEFORE the package is updated with the update command.
    
       update, postupdate
              Run AFTER the package is updated with the update command.
    
       prepublish
              Run BEFORE the package is published.
    
       publish, postpublish
              Run AFTER the package is published.
    
       pretest, test, posttest
              Run by the npm test command.
    
       prestop, stop, poststop
              Run by the npm stop command.
    
       prestart, start, poststart
              Run by the npm start command.
    
       prerestart, restart, postrestart
              Run by the npm restart command. Note: npm restart will  run  the
              stop and start scripts if no restart script is provided.
    
       Additionally,  arbitrary  scrips  can  be  run  by doing npm run-script
       <stage> <pkg>.
    

    Note, publish here is for publishing a module to npm. You should set your package to private ("private": true) so you don’t accidentally publish your code the the npm repository.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.