vscode

vscode code-snippets

NPM

njt


{
    "NPM JSON Template": {
        "prefix": "njt",
        "body": [
            "{",
            "   \"name\": \"$1npm node project\",",
            "   \"description\": \"$2an open source project created by xgqfrms\",",
            "   \"author\": \"xgqfrms\",",
            "   \"version\": \"1.1.1\",",
            "   \"license\": \"MIT\",",
            "   \"private\": true,",
            "   \"scripts\": {",
            "       \"dev\": \"npm run start\",",
            "       \"app\": \"npm run build\",",
            "       \"rmrf\": \"rimraf dist/**/*\",",
            "       \"map\": \"rimraf dist/**/*.map\"",
            "   },",
            "   \"bin\": {",
            "       \"dev\": \"dev\",",
            "       \"app\": \"app\"",
            "   },",
            "   \"keywords\": [",
            "       \"Node.js\",",
            "       \"NPM\",",
            "       \"JS\"",
            "   ]",
            "",
            "}"
        ],
        "description": "NPM JSON Template & code snippets!"
    }
}

JavaScript & React

js6r

{
    "JavaScript ES6 React Template": {
        "prefix": "js6r",
        "body": [
            "\"use strict\";",
            "",
            "/**",
            " * ",
            " * @author xgqfrms",
            " * @license MIT",
            " * @copyright xgqfrms",
            " * ",
            " * @description $2",
            " * @augments $3",
            " * @example $4",
            " * ",
            " */",
            "",
            "const $2Generator = ($5datas = [], debug = false) => {",
            "    let result = ``;",
            "    // do something...",
            "    return $7result;",
            "};",
            "",
            "",
            "",
            "export default $2;",
            "",
            "export {",
            "    $2,",
            "};",
            "",
        ],
        "description": "JavaScript ES6 React Template & code snippets!"
    }
}

HTML5

h5t

{
    "HTML5 Template": {
        "prefix": "h5t",
        "body": [
            "<!DOCTYPE html>",
            "<html lang=\"zh-Hans\">",
            "<head>",
            "    <meta charset=\"UTF-8\">",
            "    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
            "    <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
            "    <meta name=\"author\" content=\"xgqfrms\">",
            "    <meta name=\"generator\" content=\"VS code\">",
            "    <title>$1</title>",
            "</head>",
            "<body>",
            "    <section>",
            "        <h1>$2</h1>",
            "        <a href=\"https://feiqa.xgqfrms.xyz/index.html\">$3</a>",
            "    </section>",
            "</body>",
            "</html>"
        ],
        "description": "HTML5 Template & code snippets!"
    }
}

c3t

{
    "CSS3 Template": {
        "prefix": "c3t",
        "body": [
            "@charset \"UTf-8\";",
            "",
            "/* $1.css */\n",
            ":root {",
            "   --cololr: $2;",
            "   --default-cololr: $2;",
            "   --new-cololr: $3;",
            "}",
        ],
        "description": "CSS3 Template & code snippets!"
    }
}

JSON



{
    "NPM JSON Template": {
        "prefix": "njt",
        "body": [
            "{",
            "   \"name\": \"$1npm node project\",",
            "   \"description\": \"$2an open source project created by xgqfrms\",",
            "   \"author\": \"xgqfrms\",",
            "   \"version\": \"1.1.1\",",
            "   \"license\": \"MIT\",",
            "   \"private\": true,",
            "   \"scripts\": {",
            "       \"dev\": \"npm run start\",",
            "       \"app\": \"npm run build\",",
            "       \"rmrf\": \"rimraf dist/**/*\",",
            "       \"map\": \"rimraf dist/**/*.map\"",
            "   },",
            "   \"bin\": {",
            "       \"dev\": \"dev\",",
            "       \"app\": \"app\"",
            "   },",
            "   \"keywords\": [",
            "       \"Node.js\",",
            "       \"NPM\",",
            "       \"JS\"",
            "   ]",
            "",
            "}"
        ],
        "description": "NPM JSON Template & code snippets!"
    }
}

JSON5


{
    "JSON5 Template": {
        "prefix": "json5",
        "body": [
            "{",
            "   \"name\": \"$1npm node project\",",
            "   \"description\": \"$2an open source project created by xgqfrms\",",
            "   \"author\": \"xgqfrms\",",
            "   \"version\": \"1.1.1\",",
            "   \"license\": \"MIT\",",
            "   \"private\": true,",
            "   \"scripts\": {",
            "       \"dev\": \"npm run start\",",
            "       \"app\": \"npm run build\",",
            "       \"rmrf\": \"rimraf dist/**/*\",",
            "       \"map\": \"rimraf dist/**/*.map\"",
            "   },",
            "   \"bin\": {",
            "       \"dev\": \"dev\",",
            "       \"app\": \"app\"",
            "   },",
            "   \"keywords\": [",
            "       \"Node.js\",",
            "       \"NPM\",",
            "       \"JS\"",
            "   ]",
            "",
            "}"
        ],
        "description": "JSON5 Template & code snippets!"
    }
}

JSONC

JSON with Comments


{
    "JSON with Comments Template": {
        "prefix": "jsonc",
        "body": [
            "{",
            "   \"name\": \"$1npm node project\",",
            "   \"description\": \"$2an open source project created by xgqfrms\",",
            "   \"author\": \"xgqfrms\",",
            "   \"version\": \"1.1.1\",",
            "   \"license\": \"MIT\",",
            "   \"private\": true,",
            "   \"scripts\": {",
            "       \"dev\": \"npm run start\",",
            "       \"app\": \"npm run build\",",
            "       \"rmrf\": \"rimraf dist/**/*\",",
            "       \"map\": \"rimraf dist/**/*.map\"",
            "   },",
            "   \"bin\": {",
            "       \"dev\": \"dev\",",
            "       \"app\": \"app\"",
            "   },",
            "   \"keywords\": [",
            "       \"Node.js\",",
            "       \"NPM\",",
            "       \"JS\"",
            "   ]",
            "",
            "}"
        ],
        "description": "JSON with Comments Template & code snippets!"
    }
}


TypeScript

{
  "TypeScript Template": {
    "prefix": "tst",
    "body": [
      "\"use strict\";",
      "",
      "/**",
      " * ",
      " * @author xgqfrms",
      " * @license MIT",
      " * @copyright xgqfrms",
      " * @created 2022-08-0$1",
      " * @modified ",
      " * ",
      " * @description ",
      " * @description ",
      " * @difficulty Easy Medium Hard",
      " * @ime_complexity O(n)",
      " * @space_complexity O(n)",
      " * @augments ",
      " * @example ",
      " * @link https://leetcode.com/problems/$2/",
      " * @link https://leetcode.cn/problems/$2/",
      " * @solutions ",
      " * ",
      " * @best_solutions ",
      " * ",
      " */",
      "",
      "export {};",
      "",
      "const log = console.log;",
      "",
      "// Generator",
      "const $3 = ($5datas = [], debug = false) => {",
      "  let result = ``;",
      "  // do something...",
      "  return $7result;",
      "};",
      "",
      "",
      "export default $3;",
      "export {",
      "  $3,",
      "};",
      "",
      "/*",
      "",
      "",
      "// 桋试用例 test cases",
      "const testCases = [",
      "  {",
      "    input: '4193 with words  ',",
      "    result: 4193,",
      "    desc: 'value equal to 4193',",
      "  },",
      "];",
      "for (const [i, testCase] of testCases.entries()) {",
      "  const result = $3(testCase.input);",
      "  log(`test case ${i} result: `, result === testCase.result ? `βœ… passed` : `❌ failed`, result);",
      "  // log(`test case ${i} result:\n\t\t`, result === testCase.result ? `passed βœ…` : `failed ❌`, result);",
      "  // log(`test case ${i} =`, testCase);",
      "}",
      "",
      "",
      "*/",
      "",
    ],
    "description": "TypeScript Template & code snippets!"
  }
}

TypeScript & React

tsrt


{
  "TypeScript React Template": {
    "prefix": "tsrt",
    "body": [
      "\"use strict\";",
      "",
      "/**",
      " * ",
      " * @author xgqfrms",
      " * @license MIT",
      " * @copyright xgqfrms",
      " * @created 2022-10-0$1",
      " * @modified ",
      " * ",
      " * @description ",
      " * @description ",
      " * @difficulty Easy Medium Hard",
      " * @ime_complexity O(n)",
      " * @space_complexity O(n)",
      " * @augments ",
      " * @example ",
      " * @link https://leetcode.com/problems/$2/",
      " * @link https://leetcode.cn/problems/$2/",
      " * @solutions ",
      " * ",
      " * @best_solutions ",
      " * ",
      " */",
      "",
      "export {};",
      "",
      "const log = console.log;",
      "",
      "// Generator",
      "const $3 = ($5datas = [], debug = false) => {",
      "  let result = ``;",
      "  // do something...",
      "  return $7result;",
      "};",
      "",
      "",
      "export default $3;",
      "export {",
      "  $3,",
      "};",
      "",
      "/*",
      "",
      "",
      "// 桋试用例 test cases",
      "const testCases = [",
      "  {",
      "    input: '4193 with words  ',",
      "    result: 4193,",
      "    desc: 'value equal to 4193',",
      "  },",
      "];",
      "for (const [i, testCase] of testCases.entries()) {",
      "  const result = $3(testCase.input);",
      "  log(`test case \\${i} result: `, result === testCase.result ? `βœ… passed` : `❌ failed`, result);",
      "  // log(`test case ${i} result: `, result === testCase.result ? `passed βœ…` : `failed ❌`, result);",
      "  // log(`test case ${i} =`, testCase);",
      "}",
      "",
      "",
      "*/",
      ""
    ],
    "description": "TypeScript React Template & code snippets!"
  }
}