fiddle

tilde(~) vs caret(^) in package.json

See the NPM docs and semver docs:

  • ~version “Approximately equivalent to version”, will update you to all future patch versions, without incrementing the minor version. ~1.2.3 will use releases from 1.2.3 to <1.3.0.

  • ^version “Compatible with version”, will update you to all future minor/patch versions, without incrementing the major version. ^2.3.4 will use releases from 2.3.4 to 3.0.0

esxpress-es6-example

githubHow to enable ES6 (and beyond) syntax with Node and Express

Monorepo vs Multirepo

A monorepo keeps everything in one repository. A multirepo (multiple repositories) typically has one repository for each project. The more projects, the more repositories. A multirepo is also known as polyrepo.

So, which one is better? Should you keep everything together in one repository? Or should you divide it up into multiple repositories?

Monorepo Is Usually Best For…

  • Visibility Using a single repository gives you visibility into your code and assets for every project. This helps you manage dependencies.

  • Collaboration A single repository makes it easier to collaborate. That’s because everyone can access the code, files, and assets. So, developers can share and reuse assets.

  • Speed Using a single repository can help you accelerate development. For instance, you can make atomic changes (one action to make a change across multiple projects).

Multirepo Is Usually Best For…

  • Git Projects Managing a monorepo at scale in Git would never work. As the repository gets bigger, a monorepo in Git becomes a huge problem. So if you have teams using Git, it’s best to have multiple repositories.

  • Open Source or Third Party Projects In some version control systems, you’ll need multiple repositories to use open source projects or work with third party teams. Then you can ensure that third party developers only have access to the project they're working on.

semantic version definition

semver specification

Given a version number MAJOR.MINOR.PATCH, increment the: MAJOR version when you make incompatible API changes, MINOR version when you add functionality in a backwards compatible manner, and PATCH version when you make backwards compatible bug fixes. Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

URL vs URI

  • (统一资源标识符)Uniform Resource Identifier,URI

  • 统一资源定位器(Uniform Resource Locators,URL)

URLURI
URL is used to describe the identity of an item.URI provides a technique for defining the identity of an item.
URL links a web page, a component of a web page or a program on a web page with the help of accessing methods like protocols.URI is used to distinguish one resource from other regardless of the method used.
URL provides the details about what type of protocol is to be used.URI doesn’t contains the protocol specification.
URL is a type of URI.URI is the superset of URL.

when to use useMemo and useCallback

when to use useMomo and useCallback

Performance optimizations are not free. They ALWAYS come with a cost but do NOT always come with a benefit to offset that cost.

cxcybn

cxcybn is a password strength estimator inspired by password crackers. Through pattern matching and conservative estimation, it recognizes and weighs 30k common passwords, common names and surnames according to US census data, popular English words from Wikipedia and US television and movies, and other common patterns like dates, repeats (aaa), sequences (abcd), keyboard patterns (qwertyuiop), and l33t speak.

git pull merge vs git pull rebase

git pull = git fetch + git merge what’s the difference between Git pull rebase and Git pull merge?

  • Git pull merge is the default method for combining changes in Git, and will merge the unpublished changes with the published changes, resulting in a merge commit.
  • Git pull rebase, on the other hand, the unpublished changes will be reapplied on top of the published changes and no new commit will be added to your history.
  • With this in mind, you can see that Git pull rebase will result in a linear and cleaner project history by removing the unneeded merge commit.

Last Updated: