As easy as 1, 2, 3!
Updated:
- Aug, 08, 2022 update
configdocs for npm 8+ - Jul 27, 2021 add private scopes
- Jul 22, 2021 add dist tags
- Jun 20, 2021 update for
--access=public - Sep 07, 2020 update docs for
npm version
| function declOfNum(number, titles) { | |
| cases = [2, 0, 1, 1, 1, 2]; | |
| return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ]; | |
| } | |
| use: | |
| declOfNum(count, ['найдена', 'найдено', 'найдены']); |
| Terminal commands |
| // give it a name so it reuses the same window | |
| var win = window.open(null, "redux-devtools", "menubar=no,location=no,resizable=yes,scrollbars=no,status=no"); | |
| // reload in case it's reusing the same window with the old content | |
| win.location.reload(); | |
| // wait a little bit for it to reload, then render | |
| setTimeout(function() { | |
| React.render( | |
| <DebugPanel top right bottom left > |
| "use strict" | |
| function progress(strs, current, total) { | |
| let str = `${strs[0]}${current}${strs[1]}${total}${strs[2]}` | |
| let ratio = Math.min(Math.max(current / total, 0), 1) | |
| let length = Math.floor(ratio * str.length) | |
| let pattern = new RegExp(`^.{${length}}`) | |
| return str.replace(pattern, "\x1b[4m$&\x1b[0m") | |
| } |
| { | |
| "env": { | |
| "development": { | |
| "plugins": ["react-transform"], | |
| "extra": { | |
| "react-transform": { | |
| "transforms": [{ | |
| "transform": "react-transform-hmr", | |
| "imports": ["react"], | |
| "locals": ["module"] |
Hexlet Workshop - четырех часовое мероприятие, которое направлено на прокачку новых навыков в новых для себя областях. Проводится для всех желающих.