js

image post

jsonplaceholder: a free fake API for testing and prototyping

JSONPlaceholder is a free online REST API that you can use whenever you need some fake data.
Andrés Canavesi - Sep 13, 2021

image post

Prettier config

Prettier is a code formatter that supports many languages and can be integrated with most of the editors.
Andrés Canavesi - Sep 09, 2021
With Prettier you will be able to define your own rules, however default rules are enough at the beginning.

image post

Sitemap xml creation

A sitemap is very important if you want to search engines discover and index your site properly.
Andrés Canavesi - Sep 09, 2021
No matter the language you are using in your site, this is the right way to create a sitemap.

image post

Salesforce rest api download ContentVersion

Download a Salesforce file (ContentVersion) through the API using Node.js with jsforce package
Andrés Canavesi - Sep 09, 2021

image post

flexsearch example

A super simple example to show how to index a collection of data and then run a full-text search
Andrés Canavesi - Sep 09, 2021
flexsearch It's an awesome package to index in-memory data


image post

How to make Load and Smoke testing with Artillery

Artillery is a CLI tool installed easily through npm
Andrés Canavesi - May 20, 2021
Artillery is a modern load testing and smoke testing solution designed for cross-functional teams that run microservice-based systems on AWS and rely on CI/CD to ship at high velocity

image post

Download and save a file in Node.js

Get a file from a server and store it in your disk
Andrés Canavesi - May 13, 2021
Download a file in Node.js is pretty straightforward. We are going to make an implementation using native modules. No third parties.

image post

How to trigger a Lambda with a SQS message

AWS SAM template to execute a Lambda Function by writing a message in a SQS queue. Cloudformation world
Andrés Canavesi - May 12, 2021
Let's create a SAM template to declare a Lambda function to be triggered from an SQS message

image post

How to setup Github Actions workflow lint

Configure a workflow to execute your linter when pushing code
Andrés Canavesi - Apr 25, 2021
How to setup Github Actions workflow lint

image post

How to download a Salesforce file from Node.js

A JavaScript snippet to download a Salesforce file using the Rest API
Andrés Canavesi - Apr 20, 2021
Download a file from Salesforce using Node.js

image post

Detect record changes in a Lightning Component

Listen to events when a record changes outside your Lightning component
Andrés Canavesi - Apr 16, 2021
Listening to changes in a Lightning Component from record changes

image post

Dealing with concurrency in Node.js

Yeap, race condition is present also in Node.js regardless the single thread Event Loop
Andrés Canavesi - Aug 30, 2020
Even though the Event Loop is a single thread we have to take care of race condition since 99% of our code will run in a non main thread.

image post

How to use a GitHub repository as a dependency in Node.js

Andrés Canavesi - Aug 30, 2020
Sometimes you need a dependency that is not published as a regular package at npmjs.com

image post

Detect if a string is a number with regex

Andrés Canavesi - Aug 28, 2020
How to know if a string is a number in JavaScript using a regular expression

image post

Clean up more than two spaces and new lines with regex

A simple JavaScript method that removes all newlines and multiple spaces from a given text
Andrés Canavesi - Aug 28, 2020
A simple JavaScript method that removes all new lines and multiple spaces (including tab spaces) by a single space

image post

Improve pg-promise stack traces

Andrés Canavesi - Aug 27, 2020
When you execute a query with error, we get a pg-promise internal module-specific stack trace.

image post

How to use node-cache to accelerate queries

Using node-cache package to cache heavy and frequent queries in Node.js
Andrés Canavesi - Aug 25, 2020
Database access is usually expensive so you should optimize roundtrips as much as possible.

image post

pg-promise self signed certificate error in Postgres

To fix this issue you have to use the package with the following recommendations
Andrés Canavesi - Aug 20, 2020
If you are using Node.js with some of these packages: pg-promise or pg probably you are facing this issue.

image post

How to connect to a Redshift database from Node.js

See how to use pg-promise to connect to a AWS Redshift database
Andrés Canavesi - Aug 11, 2020
A util piece of code to connect to a Redshift database