3 Useful JavaScript Snippets. Auto commit to Gitlab, create object… | by Emil Hein

Auto decide to Gitlab, create object with X keys and Y as worth, and extra

The beneath snippet will add a file to a Gitlab repository.
You may use the snippet in your CI/CD pipeline or your backend to maintain information up to date each time a sure occasion occurs.

Programmatically decide to Gitlab

Should you change 11 to a different quantity, you’ll change the scale of the article (variety of keys) and in the event you change “true”, you’ll change the worth of all of the keys:

Beneath gist will run by way of the number one to 150 and execute an async perform at a time.

This may be helpful in the event you’re requesting an API with the throttle or in case your async perform takes quite a lot of reminiscence or CPU, so you possibly can’t execute them in parallel.

More Posts