Ниже будут приведены аргументы в пользу выбора Mocha
-
Высокая популярность:
— 2m против 400 k загузок в месяц -
Высокая активность:
— 1 890 против 1400 коммитов (всего)
— 171 против 101 коммитов (последний год)
| // Файл "tsconfig.json": | |
| // - устанавливает корневой каталог проекта TypeScript; | |
| // - выполняет настройку параметров компиляции; | |
| // - устанавливает файлы проекта. | |
| // Присутствие файла "tsconfig.json" в папке указывает TypeScript, что это корневая папка проекта. | |
| // Внутри "tsconfig.json" указываются настройки компилятора TypeScript и корневые файлы проекта. | |
| // Программа компилятора "tsc" ищет файл "tsconfig.json" сначала в папке, где она расположена, затем поднимается выше и ищет в родительских папках согласно их вложенности друг в друга. | |
| // Команда "tsc --project C:\path\to\my\project\folder" берет файл "tsconfig.json" из папки, расположенной по данному пути. | |
| // Файл "tsconfig.json" может быть полностью пустым, тогда компилятор скомпилирует все файлы с настройками заданными по умолчанию. | |
| // Опции компилятора, перечисленные в командной строке перезаписывают собой опции, заданные в файле "tsconfig.json". |
| /** | |
| * This gist is for Javascript beginners. | |
| * @author: Anthony Du Pont <[email protected]> | |
| * @site: https://www.twitter.com/JsGists | |
| * | |
| * In episode #11 of "Gist for Javascript Beginners" I explained what was a Linear Interpolation. | |
| * In this episode I'll show you another case it's really usefull. | |
| * | |
| * It's a trend since a few months to add smooth scroll to websites because the look-and-feel is | |
| * better than the basic scroll of the browser. But how do you do this kind of effect ? Thanks |
| /** | |
| * This gist is for Javascript beginners. | |
| * @author: Anthony Du Pont <[email protected]> | |
| * @site: https://www.twitter.com/JsGists | |
| * | |
| * You sometimes need to run some code multiples times, on window scroll, on window resize | |
| * or simply every n milliseconds. But what if you want you code to run 60 times per seconds ? | |
| * You could defenitely use a `setTimeout` and even if it's not the best solution | |
| * it would work but! there is a much easier solution, `requestAnimationFrame` (rAF). | |
| * |
| /** | |
| * This gist is for Javascript beginners. | |
| * @author: Anthony Du Pont <[email protected]> | |
| * @site: https://www.twitter.com/JsGists | |
| * | |
| * It's very common in Javascript to normalize numbers. Normalization means that you are taking a number from a range | |
| * and return a value from 0 to 1 corresponding to the position of this number within this range. | |
| * | |
| * If the number is equal to the minimum value of the range, the normal value is 0. | |
| * If the number is equal to the maximum value of the range, the normal value is 1. |
| /** | |
| * This gist is for Javascript beginners. | |
| * @author: Anthony Du Pont <[email protected]> | |
| * @site: https://www.twitter.com/JsGists | |
| * | |
| * Linear Interpolation is a method to add some natural behaviors to your animations. The more natural | |
| * your animations look like, the better will be the look-and-feel. But what's Linear Interpolation ? | |
| * | |
| * Linear Interpolation, also called `lerp`, is a way of easing your animation. Imagine you want to | |
| * move a box from a position A to a position B. Without the Linear Interpolation, you box will |
| var fragmentShader = ` | |
| #define PI 3.1415926535897932384626433832795 | |
| uniform float u_time; | |
| uniform vec2 u_res; | |
| float range01(float num) { | |
| return .5 + .5 * sin(num); | |
| } | |
| float getRed(vec2 xy) { |
| var fs = require('fs') | |
| , path = require('path') | |
| , _ = require('underscore'); | |
| var rootPath = "/path/to/remove"; | |
| removeDirForce(rootPath); | |
| // path should have trailing slash | |
| function removeDirForce(dirPath) { | |
| fs.readdir(dirPath, function(err, files) { |
| /** | |
| * Goes through the given directory to return all files and folders recursively | |
| * @author Ash Blue [email protected] | |
| * @example getFilesRecursive('./folder/sub-folder'); | |
| * @requires Must include the file system module native to NodeJS, ex. var fs = require('fs'); | |
| * @param {string} folder Folder location to search through | |
| * @returns {object} Nested tree of the found files | |
| */ | |
| // var fs = require('fs'); | |
| function getFilesRecursive (folder) { |