Post/Code

HomeAboutUsesNow

This and That.

Faker.

Faker.js is a really cool utility library for generating, you guessed it! Fake data. This is especially useful when working on prototypes or MVPs before you have real data but don't want everything to look like it has been cut and pasted from the same place. Simple to use:

yarn add faker

In index.js:

import faker from 'faker';
...
const name = faker.name.firstName(); // generates a random name
const img = faker.image.avatar(); // generates a fake avatar

What I really like about the above, is that each time you refresh the page, it gives you fresh new data. Even better is that you no longer need to go and copy/paste lorem ipsum text from your favourite lipsum generator. Faker provides out of the box:

const copy = faker.lorem.sentences(); // generates random lorem ipsum sentence copy.

Diffchecker.

I have long been a fan of Beyond Compare for checking diffs. Granted, I have only used it on Windows machines. Today I came across an online tool called Diffchecker which seems like a great option to use without having to install anything.

Update npm within nvm.

NVM is great for managing Node versions on your machine. As one often does, npm gave me a notice that there was a newer version of npm available via npm i -g npm.

It suddenly dawned on me, that running this only updated the npm version of my global instance and not the version of npm within my nvm. A quick search revealed that I could use the following:

nvm install-latest-npm

This will update the version of npm running within your current active Node version inside nvm.

Npx.

npx create-react-app projectNameHere