Should I Clone A Node Library Inside Node_modules To Modify It?
I'm using Poet for a blogging/static site generator engine and it's great.
It is currently a dependency listed in my packages.json, so I simply
npm install it and
require it in my express app.
However, I'd like to change one behavior in the library (especifically the way a "post.preview" is constructed, which right now simply gets the first line, and I'd like to perhaps be able to configure a number of lines for each post).
To do that, I'm considering cloning the repo and making the change.
But I'm wondering if I should:
- Clone it directly to my blog/node_modules/poet and
requireit as usual or,
- Clone it to a different folder and
requireit from a different path.
Keep in mind that I'd like to publish soon to Heroku or Nodejitsu.
What are your thoughts on that?
UPDATE: I had a few problems having a git repo with the cloned lib under my git repo. It somehow added the whole folder as a file. I promptly removed '.git' from the lib folder and everything went back to normal... I don't know the cause of this behavior!
IMHO, a good practice is to clone and keep this repository into the folder
/lib. Once you feel you are done with your changes, push them into your version, and make the right references to your copy in the
Now, if you think your changes could be introduced into the module, make the pull request.
My two cents.
- → Authenticate with a cookie using laravel 5.1 and jwt
- → Finding a specific GitLab tag from PHP
- → React: How to publish page on server using React-starter-kit
- → babel-loader, webpack, ES2015 modules: "Element type is invalid"
- → Create a function-attribute of a function, which is, in its turn, a method of an object literal
- → Model Validation in laravel 5.1 not working
- → GIT fatal: loose object
- → Laravel validation required rule not working
- → Axios array map callback
- → Where does this `webpack://` come from for `webpack-dev-middleware`?
- → error when trying to modify project in laravel forge
- → GitHub Pages and Jekyll content duplication and SEO issues
- → Use Laravel repositories with Datatables