in javascript serverless yarn npm ~ read.
Keeping your serverless project size nice and clean

Keeping your serverless project size nice and clean

At New10, as a Software Engineer in Test, i'm quite often build some small serverless projects that help our teams to make test automation and debugging of our system. Easier. I'm working now more and more with things like yarn, javascript and serverless framework. Today i discovered a nice yarn autoclean trick :

  1. First run yarn autoclean --init -> this will create .yarnclean file.
  2. Then run yarn autoclean --force -> if you have some packages in node_modules folder that you don't use anymore in the project - yarn will remove it.

It's aspecially can be helpfull for serverless projects - it can improve lambda cold start time, which is always nice :)

With npm you can use npm prune command.

Most probably every javascript developer already knows about it, but for me it's a nice discovery :)

comments powered by Disqus
comments powered by Disqus