# JavaScript
# Flag
对网页行为进行编程,Vanilla JS 就是指JavaScript(ECMAscript)
- ECMAScript支持度检测 https://github.com/ruanyf/es-checker (opens new window)
- 检查JS文件中的ES版本 https://github.com/dollarshaveclub/es-check (opens new window)
- ES6支持情况 https://github.com/kangax/compat-table (opens new window)
- https://github.com/financial-times/polyfill-service (opens new window)
- https://github.com/taylorhakes/promise-polyfill (opens new window)
Polyfill (opens new window) 是一块代码(通常是 Web 上的 JavaScript) ,用来为旧浏览器提供它没有原生支持的较新的功能
- 服务器实时消息获取的技术方案 (opens new window)
- JS刷新当前页面的几种方法总结 (opens new window)
- js keyup、keypress和keydown事件 详解 (opens new window)
- js中keyup-keypress-keydown以及oninput四个事件 (opens new window)
- keydown,keypress,keyup三者之间的区别 (opens new window)
- 前端三大框架与 YUI 以及 EXT.js 这类组件化框架最大的区别是什么? (opens new window)
- ECMAscript和Javascript的区别 (opens new window)
- KeyboardEvent.keyCode已弃用,MDN已经提供了一个解决方案 (opens new window)
- JS 获取内网 IP 地址(兼容谷歌浏览器) (opens new window)
- https://github.com/wingscloud (opens new window)
- 部署同步 https://github.com/Browsersync/browser-sync (opens new window)
js运行时/js引擎/JavaScript运行时/JavaScript引擎
- 恶意软件分析 https://github.com/HynekPetrak/malware-jail (opens new window)
- 物联网的超轻量级JavaScript引擎 https://github.com/jerryscript-project/jerryscript (opens new window)
- 嵌入式系统的微型JS引擎 https://github.com/cesanta/elk (opens new window)
- https://github.com/boa-dev/boa (opens new window)
- https://github.com/denoland/deno (opens new window)
- https://github.com/servo/servo (opens new window)
- https://github.com/bellard/quickjs (opens new window)
- https://github.com/saghul/txiki.js (opens new window)
- https://github.com/oven-sh/bun (opens new window)
- https://github.com/svaarala/duktape (opens new window)
- https://mujs.com (opens new window)
- https://github.com/gfwilliams/tiny-js (opens new window)
- https://github.com/cesanta/v7 (opens new window)
- https://github.com/zurb/tribute (opens new window)
- https://github.com/dop251/goja (opens new window)
- https://github.com/chakra-core/ChakraCore (opens new window)
- https://github.com/eclipsesource/J2V8 (opens new window)
- https://github.com/oracle/graaljs (opens new window)
- https://github.com/mozilla/rhino (opens new window)
- https://github.com/gwtproject/gwt (opens new window)
- https://github.com/CanadaHonk/porffor (opens new window)
# 学习
- https://github.com/topics/es6 (opens new window)
- https://github.com/topics/es2016 (opens new window)
- https://github.com/topics/linting (opens new window)
- https://github.com/ruanyf/jstutorial (opens new window)
- https://github.com/revolunet/JSbooks (opens new window)
- https://exploringjs.com (opens new window)
- https://github.com/es5/es5.github.io (opens new window)
- ECMAScript 6入门 https://github.com/ruanyf/es6tutorial (opens new window)
- https://github.com/ericdouglas/ES6-Learning (opens new window)
- https://github.com/lukehoban/es6features (opens new window)
- https://github.com/rse/es6-features (opens new window)
- 特性列表 https://github.com/daumann/ECMAScript-new-features-list (opens new window)
- https://github.com/sudheerj/ECMAScript-features (opens new window)
- https://github.com/30-seconds (opens new window)
- https://www.javascript.com (opens new window)
- 现代JavaScript教程 https://github.com/javascript-tutorial/zh.javascript.info (opens new window)
- 浏览器脚本教程 https://www.w3school.com.cn/b.asp (opens new window)
- 参考手册 https://www.w3school.com.cn/r.asp (opens new window)
- JavaScript基础知识 https://www.kancloud.cn/yangguangzhang/yangguangzhang--javascript (opens new window)
- https://github.com/2xiao/leetcode-js (opens new window)
- 文档对象模型 (DOM) https://developer.mozilla.org/zh-CN/docs/Glossary/DOM (opens new window)
- https://github.com/Asabeneh/30-Days-Of-JavaScript (opens new window)
- https://github.com/wesbos/JavaScript30 (opens new window)
- https://gaohaoyang.github.io (opens new window)
- 答题 https://github.com/lydiahallie/javascript-questions (opens new window)
- https://github.com/felipefialho/frontend-challenges (opens new window)
- https://github.com/coffe1891/frontend-hard-mode-interview (opens new window)
- https://github.com/icepy/Front-End-Develop-Guide (opens new window)
- https://github.com/you-dont-need (opens new window)
- https://github.com/getify/You-Dont-Know-JS (opens new window)
- https://github.com/Asabeneh/JavaScript-for-Everyone (opens new window)
- 学习代码总结 https://github.com/csxiaoyaojianxian/JavaScriptStudy (opens new window)
- https://github.com/comehope/front-end-daily-challenges (opens new window)
- https://github.com/gothinkster/realworld (opens new window)
- https://github.com/tanpero/JavaScript-Art-Tour (opens new window)
- 前端面试手册 https://github.com/yangshun/front-end-interview-handbook (opens new window)
- https://github.com/loverajoel/jstips (opens new window)
- https://www.javascriptcn.com (opens new window) 1212/1024
- https://github.com/superherojs/superherojs (opens new window)
- 单行代码 https://github.com/1milligram/1loc (opens new window)
- ES6、ES7、ES8特性一锅炖(ES6、ES7、ES8学习指南) (opens new window)
- ES6、ES7、ES8、ES9、ES10新特性一览 (opens new window)
- 页面生命周期:DOMContentLoaded,load,beforeunload,unload (opens new window)
模块规范
UMD(Universal Module Definition) https://github.com/umdjs/umd (opens new window)
AMD(Asynchronous Module Definition) https://github.com/amdjs (opens new window)
CMJ(CommonJS) https://github.com/cmdjs (opens new window)
ESM(ECMAScript modules) https://nodejs.org/api/esm.html (opens new window)
/**
* CommonJS 主要是NodeJs使用
* 在一个node执行一个文件时,会给这个文件内生成一个 exports和module对象,而module有一个exports属性。
* exports = module.exports = {};
*/
module.exports.x = x; // 导出模块
module.exports = {};
// 为了方便,Node为每个模块提供一个exports变量,指向module.exports
// 注意,不能直接将exports变量指向一个值,因为这样等于切断了exports与module.exports的联系
//exports.x = x;
var example = require('./example.js'); // 导入模块
/**
* AMD(Asynchronous Module Defination,浏览器端js模块化) 主要是RequireJS使用
*/
//定义模块myModule.js
define(['dependency'],function(){
var name = 'Bily';
function printName(){
console.log(name);
}
return {
printName: printName
}
});
//加载模块
require(['myModule'],function(my){
my.printName();
});
/**
* CMD(Common Module Definition,通用模块定义)
*/
// cmd1.js
define(function(require,exports,module){
// ...
module.exports={
// ...
}
});
// cmd2.js
define(function(require,exports,module){
var cmd2 = require('./cmd1')
// cmd2.xxx 依赖就近书写
module.exports={
// ...
}
});
/**
* ECMAScript6
* export与export default均可用于导出常量、函数、文件、模块等
* 在一个文件或模块中,export、import可以有多个,export default仅有一个
* 通过export方式导出,在导入时要加{ },export default则不需要
* export能直接导出变量表达式,export default不行。
*/
export x = x; // 导出模块
export default {} // 为模块指定默认输出
import { stat, exists, readFile } from 'fs'; // 导入模块
var express = require('express');
Uncaught SyntaxError: Cannot use import statement outside a module
在报错是说无法在模块外部使用
import
语句,因为Module
的加载实现的是es6
语法, 所以在浏览器加载html
文件时,需要在script
标签中加入type="module"
属性。
<script type="module" src="/static/js/index.js"></script>
# 微前端
Micro-frontends
- https://github.com/smapiot/piral (opens new window)
- https://github.com/single-spa (opens new window)
- https://github.com/teambit/bit (opens new window)
- https://github.com/systemjs (opens new window)
- https://github.com/opencomponents (opens new window)
- https://github.com/umijs/qiankun (opens new window)
- https://github.com/SAP/luigi (opens new window)
- https://github.com/frintjs/frint (opens new window)
- https://github.com/puzzle-js (opens new window)
← HTML JavaScript框架 →