# core-js
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/zloirock/core-js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![version](https://img.shields.io/npm/v/core-js.svg)](https://www.npmjs.com/package/core-js) [![npm downloads](https://img.shields.io/npm/dm/core-js.svg)](http://npm-stat.com/charts.html?package=core-js&author=&from=2014-11-18) [![Build Status](https://travis-ci.org/zloirock/core-js.svg)](https://travis-ci.org/zloirock/core-js) [![devDependency status](https://david-dm.org/zloirock/core-js/dev-status.svg)](https://david-dm.org/zloirock/core-js?type=dev)
#### As advertising: the author is looking for a good job :)
Modular standard library for JavaScript. Includes polyfills for [ECMAScript 5](#ecmascript-5), [ECMAScript 6](#ecmascript-6): [promises](#ecmascript-6-promise), [symbols](#ecmascript-6-symbol), [collections](#ecmascript-6-collections), iterators, [typed arrays](#ecmascript-6-typed-arrays), [ECMAScript 7+ proposals](#ecmascript-7-proposals), [setImmediate](#setimmediate), etc. Some additional features such as [dictionaries](#dict) or [extended partial application](#partial-application). You can require only needed features or use it without global namespace pollution.
[*Example*](http://goo.gl/a2xexl):
```js
Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3]
'*'.repeat(10); // => '**********'
Promise.resolve(32).then(x => console.log(x)); // => 32
setImmediate(x => console.log(x), 42); // => 42
```
[*Without global namespace pollution*](http://goo.gl/paOHb0):
```js
var core = require('core-js/library'); // With a modular system, otherwise use global `core`
core.Array.from(new core.Set([1, 2, 3, 2, 1])); // => [1, 2, 3]
core.String.repeat('*', 10); // => '**********'
core.Promise.resolve(32).then(x => console.log(x)); // => 32
core.setImmediate(x => console.log(x), 42); // => 42
```
### Index
- [Usage](#usage)
- [Basic](#basic)
- [CommonJS](#commonjs)
- [Custom build](#custom-build-from-the-command-line)
- [Supported engines](#supported-engines)
- [Features](#features)
- [ECMAScript 5](#ecmascript-5)
- [ECMAScript 6](#ecmascript-6)
- [ECMAScript 6: Object](#ecmascript-6-object)
- [ECMAScript 6: Function](#ecmascript-6-function)
- [ECMAScript 6: Array](#ecmascript-6-array)
- [ECMAScript 6: String](#ecmascript-6-string)
- [ECMAScript 6: RegExp](#ecmascript-6-regexp)
- [ECMAScript 6: Number](#ecmascript-6-number)
- [ECMAScript 6: Math](#ecmascript-6-math)
- [ECMAScript 6: Date](#ecmascript-6-date)
- [ECMAScript 6: Promise](#ecmascript-6-promise)
- [ECMAScript 6: Symbol](#ecmascript-6-symbol)
- [ECMAScript 6: Collections](#ecmascript-6-collections)
- [ECMAScript 6: Typed Arrays](#ecmascript-6-typed-arrays)
- [ECMAScript 6: Reflect](#ecmascript-6-reflect)
- [ECMAScript 7+ proposals](#ecmascript-7-proposals)
- [stage 4 proposals](#stage-4-proposals)
- [stage 3 proposals](#stage-3-proposals)
- [stage 2 proposals](#stage-2-proposals)
- [stage 1 proposals](#stage-1-proposals)
- [stage 0 proposals](#stage-0-proposals)
- [pre-stage 0 proposals](#pre-stage-0-proposals)
- [Web standards](#web-standards)
- [setTimeout / setInterval](#settimeout--setinterval)
- [setImmediate](#setimmediate)
- [iterable DOM collections](#iterable-dom-collections)
- [Non-standard](#non-standard)
- [Object](#object)
- [Dict](#dict)
- [partial application](#partial-application)
- [Number Iterator](#number-iterator)
- [escaping strings](#escaping-strings)
- [delay](#delay)
- [helpers for iterators](#helpers-for-iterators)
- [Missing polyfills](#missing-polyfills)
- [Changelog](CHANGELOG.md)
## Usage
### Basic
```
npm i core-js
bower install core.js
```
```js
// Default
require('core-js');
// Without global namespace pollution
var core = require('core-js/library');
// Shim only
require('core-js/shim');
```
If you need complete build for browser, use builds from `core-js/client` path:
* [default](https://raw.githack.com/zloirock/core-js/v2.6.5/client/core.min.js): Includes all features, standard and non-standard.
* [as a library](https://raw.githack.com/zloirock/core-js/v2.6.5/client/library.min.js): Like "default", but does not pollute the global namespace (see [2nd example at the top](#core-js)).
* [shim only](https://raw.githack.com/zloirock/core-js/v2.6.5/client/shim.min.js): Only includes the standard methods.
Warning: if you use `core-js` with the extension of native objects, require all needed `core-js` modules at the beginning of entry point of your application, otherwise, conflicts may occur.
### CommonJS
You can require only needed modules.
```js
require('core-js/fn/set');
require('core-js/fn/array/from');
require('core-js/fn/array/find-index');
Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3]
[1, 2, NaN, 3, 4].findIndex(isNaN); // => 2
// or, w/o global namespace pollution:
var Set = require('core-js/library/fn/set');
var from = require('core-js/library/fn/array/from');
var findIndex = require('core-js/library/fn/array/find-index');
from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3]
findIndex([1, 2, NaN, 3, 4], isNaN); // => 2
```
Available entry points for methods / constructors, as above examples, and namespaces: for example, `core-js/es6/array` (`core-js/library/es6/array`) contains all [ES6 `Array` features](#ecmascript-6-array), `core-js/es6` (`core-js/library/es6`) contains all ES6 features.
##### Caveats when using CommonJS API:
* `modules` path is internal API, does not inject all required dependencies and can be changed in minor or patch releases. Use it only for a custom build and / or if you know what are you doing.
* `core-js` is extremely modular and uses a lot of very tiny modules, because of that for usage in browsers bundle up `core-js` instead of usage loader for each file, otherwise, you will have hundreds of requests.
#### CommonJS and prototype methods without global namespace pollution
In the `library` version, we can't pollute prototypes of native constructors. Because of that, prototype methods transformed to static methods like in examples above. `babel` `runtime` transformer also can't transform them. But with transpilers we can use one more trick - [bind operator and virtual methods](https://github.com/zenparsing/es-function-bind). Special for that, available `/virtual/` entry points. Example:
```js
import fill from 'core-js/library/fn/array/virtual/fill';
import findIndex from 'core-js/library/fn/array/virtual/find-index';
Array(10)::fill(0).map((a, b) => b * b)::findIndex(it => it && !(it % 8)); // => 4
// or
import {fill, findIndex} from 'core-js/library/fn/array/virtual';
Array(10)::fill(0).map((a, b) => b * b)::findIndex(it => it && !(it % 8)); // => 4
```
### Custom build (from the command-line)
```
npm i core-js && cd node_modules/core-js && npm i
npm run grunt build:core.dict,es6 -- --blacklist=es6.promise,es6.math --library=on --path=custom uglify
```
Where `core.dict` and `es6` are modules (namespaces) names, which will be added to the build, `es6.promise` and `es6.math` are modules (namespaces) names, which will be excluded from the build, `--library=on` is flag for build without global namespace pollution and `custom` is target file name.
Available namespaces: for example, `es6.array` contains [ES6 `Array` features](#ecmascript-6-array), `es6` contains all modules whose names start with `es6`.
### Custom build (from external scripts)
[`core-js-builder`](https://www.npmjs.com/package/core-js-builder) package exports a function that takes the same parameters as the `build` target from the previous section. This will conditionally include or exclude certain parts of `core-js`:
```js
require('core-js-builder')({
modules: ['es6', 'core.dict'], // modules / namespaces
blacklist: ['es6.reflect'], //
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
当下社会中,越来越多的人在追求完美,完美主义者的数量也随之增加。世界卫生组织统计,在过去25年中,我们可以看到完美主义者出现的频率正在以惊人的速度上升。许多研究发现,完美主义是导致自杀的一个致命因素。过度追求完美已经危及到人们的心理健康和生命,因此,世界卫生组已经将完美主义者列为一种疾病。 作品以三段动画短片的形式呈现三个完美主义者所发生的故事。短片整体风格采用美式漫画风格,用幽默诙谐的手法去讲述完美主义者的故事。同时,作品运用unity这一AR技术以增加该动画的趣味性,观众用unity去扫描图片,可以看到图片背后完美主义者的故事,明白动画的深层含义。 随着智能设备的普及,青少年越来越依赖电子产品,从而进一步增加了近视及相关并发症的风险。因此,病理性近视的预防意识的传播在当前社会具有重要的公共卫生意义。 作品重构了病理性近视的科普的信息内容,采用融合手绘的扁平插画风格,以直观、有趣地展示青少年病理性近视防治与相关并发症的甄别与预防信息,从而使信息传递更为准确且易于理解。同时,制作科普短片实现互联网传播 。
资源推荐
资源详情
资源评论
收起资源包目录
基于spring boot 开发,上课考勤系统毕业设计,该系统设计获得优秀毕业设计 .zip (2000个子文件)
iview.css 361KB
layui.css 59KB
layer.css 14KB
xadmin.css 10KB
layui.mobile.css 10KB
laydate.css 7KB
code.css 1KB
font.css 505B
启动说明.docx 515KB
unicode.html 43KB
echarts7.html 21KB
echarts6.html 14KB
echarts3.html 14KB
cate.html 12KB
echarts8.html 10KB
order-add.html 7KB
role-add.html 7KB
admin-rule.html 6KB
admin-list.html 6KB
member-del.html 6KB
admin-role.html 6KB
index.html 6KB
admin-edit.html 6KB
admin-add.html 6KB
admin-cate.html 6KB
sign-list.html 5KB
member-add.html 5KB
member-edit.html 5KB
echarts4.html 5KB
echarts2.html 4KB
member-password.html 4KB
login.html 4KB
echarts5.html 4KB
register.html 3KB
city.html 3KB
student-list.html 3KB
dept-list.html 3KB
echarts1.html 3KB
welcome.html 3KB
lesson-list.html 2KB
echarts.html 2KB
500.html 308B
unauthorized.html 308B
404.html 290B
order-view.html 141B
login.html 123B
CustomRealm.java 10KB
RedisSessionDAO.java 8KB
RedisCache.java 8KB
ApiLoginController.java 5KB
ApiTotalSignController.java 4KB
ApiSignController.java 4KB
ApiTeacherClassTimeController.java 4KB
SignEntity.java 4KB
CaptchaUtil.java 3KB
ApiGetStudentInfoController.java 3KB
ApiTeacherCourseController.java 3KB
ClassTimeEntity.java 3KB
AuthorizationInterceptor.java 3KB
ApiTeacherDeptController.java 3KB
ShiroSession.java 2KB
ExcelUtil.java 2KB
RedisCacheManager.java 2KB
User.java 2KB
TokenServicelmp.java 2KB
ApiUserServicelmp.java 2KB
CharUtil.java 2KB
ApiGetLoginInfoController.java 2KB
LoginUserHandlerMethodArgumentResolver.java 2KB
IndexController.java 2KB
ShiroUtils.java 2KB
CaptchaController.java 2KB
SpringContextUtils.java 2KB
MapperAspect.java 2KB
LoginController.java 2KB
SayHello.java 1KB
TokenEntity.java 1KB
ApiMenuController.java 1KB
ApiSignServicelmp.java 1KB
SignMapper.java 1KB
ApiRRException.java 1KB
R.java 1KB
AuthorizationInterceptorConfig.java 1KB
RRException.java 1017B
ApiGetSystemInfoController.java 974B
LoginUserHandlerMethodArgumentResolverConfig.java 970B
ApiAddUser.java 787B
ApiAdminMapInfo.java 738B
ApiSignMapper.java 713B
TestController.java 677B
UserMapper.java 672B
ApiUserService.java 639B
PermissionMapper.java 535B
MenuMapper.java 532B
ApiSignService.java 530B
RoleMapper.java 524B
ApiTokenMapper.java 510B
StudentMapper.java 490B
CourseMapper.java 475B
ClassTimeMapper.java 428B
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
野生的狒狒
- 粉丝: 2781
- 资源: 2222
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功