This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Assumme that we have already installed babel-cli command using `npm install --global babel-cli`. | |
1. Configuration .babelrc, the basic format of this file is shown as the following: | |
{ | |
"presets": [], | |
"plugins": [] | |
} | |
2. Install some plunins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm run-script <command> [--silent] [-- <args>...] alias: npm run | |
Given the following package.json snippet: | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"build": "babel src -d dist", | |
"run": "node dist/main.js" | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We first get a list of file with suffix | |
# and then use `cut` utility to split the | |
# full filename into a name and suffix using | |
# dot as delimiter. | |
cut -f1 -d'.' <<<$(ls *.*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In most case, if a command takes a file name as a command line arg, we can also use the content of | |
the file as the standard input of a command, the two ways have the same effect. | |
For example, a directory contains the following files: | |
example1.txt | |
example2.txt | |
example3.txt | |
example4.txt | |
example5.txt |
NewerOlder