Fork me on GitHub
  1. CommonJS和AMD/CMD

    CommonJS根据JS的表现制定规范:

    {模块引用(require)} {模块定义(exports)} {模块标识(module)}

    NodeJS遵循了CommonJS规范,写法如下:

    ```js // foo.js

    module.exports = function(x) { console.log(x); }; ```

    ```js // index.js

    let foo = require('./foo') foo(1); ```

    CommonJS主要为了JS在后 …

    read more

    There are comments.

  2. cron-parser

    Github: cron-parser

    * * * * * * ┬ ┬ ┬ ┬ ┬ ┬ │ │ │ │ │ | │ │ │ │ │ └ day of week (0 - 7) (0 or 7 is Sun) │ │ │ │ └───── month (1 - 12) │ │ │ └────────── day of month (1 - 31) │ │ └─────────────── hour (0 - 23) │ └──────────────────── minute (0 - 59) └───────────────────────── second (0 - 59, optional)

    1. 每10秒执行: */10 * * * * *
    2. 每周一10点执行: 0 0 10 ? * 1
    3. 每月1号10点执行: 0 0 10 1 * ?

    暂时 …

    read more

    There are comments.

  3. 关于通过document.styleSheets修改样式规则

    ```js var innerText = ''; function changeTheme() { try { var colors = JSON.parse( window.localStorage.getItem(window.localStorage.getItem('ROLE_ID') + '__theme') ); } catch (error) { } if (!colors) { return; } var keys = ['background', 'background-color', 'color', 'border-color'];

    var styleSheet = document.styleSheets[0].href ? document.styleSheets[0] : document.styleSheets[1];
    for (var index = 0; index < styleSheet.rules.length; index …
    read more

    There are comments.

  4. docker

    访问容器

    docker exec -it <CONTAINER ID> /bin/bash

    拷贝容器文件至本地

    docker cp <IMAGE>:<容器路径> <本地路径>

    拷贝本地文件至容器

    docker cp <本地文件> <IMAGE>:<容器路 …

    read more

    There are comments.

  5. 解决Cannot find module '../lib/completion'

    json // package.json { "scripts": { "build": "gulp build" } }

    错误:

    Error: Cannot find module '../lib/completion' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object.<anonymous> (/staticDisk/repository …

    read more

    There are comments.

  6. element-ui + element-theme + vue-cli + postcss-px2rem

    • element-ui: 1.4.2
    • vue-cli: 2.8.2

    js // utils.j exports.cssLoaders = function (options) { ... return { css: generateLoaders('postcss', { plugins() { return [require('postcss-px2rem')({ remUnit: 75 })] } }), ... } }

    js // vue-loader.conf.js module.exports = { ... postcss: [require('postcss-px2rem')({ remUnit: 75 })], ... }

    read more

    There are comments.

links