Archive a folder without redundant files using the command line on macOS.
cd <folder_path>where <folder_path> — a folder which should be archived.
zip -r .zip . -x "*.git*" -x "*.DS_Store"Archive a folder without redundant files using the command line on macOS.
cd <folder_path>where <folder_path> — a folder which should be archived.
zip -r .zip . -x "*.git*" -x "*.DS_Store"| /** | |
| * Groups an array of objects by object property | |
| */ | |
| const groupBy = <T>(array: T[], key: keyof T): { [key: string]: T[] } => { | |
| return array.reduce((accumulator: { [key: string]: T[] }, currentElement: T) => { | |
| const keyValue = currentElement[key] as unknown as string; | |
| if (keyValue in accumulator) { | |
| accumulator[keyValue].push(currentElement); | |
| } else { |
| // This function is quite flexible because it can handle any number of input arrays and | |
| // doesn't require them to be of equal length. It interleaves as many elements as possible | |
| // from each array, in the order that the arrays (and elements) were provided. | |
| /** | |
| * Interleaves elements of multiple arrays. | |
| * The function takes any number of arrays as arguments. | |
| */ | |
| function interleaveArrays(...args) { | |
| // Find the maximum length among all arrays |
How to start a new Node.js project:
npx license mit > LICENSE
npx gitignore node
npx covgen YOUR_EMAIL_ADDRESS
npm init -y