# 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&to=2114-11-18) [![Build Status](https://travis-ci.org/zloirock/core-js.png)](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#info=devDependencies)
Modular compact standard library for JavaScript. Includes polyfills for [ECMAScript 5](#ecmascript-5), [ECMAScript 6](#ecmascript-6): [symbols](#ecmascript-6-symbol), [collections](#ecmascript-6-collections), [iterators](#ecmascript-6-iterators), [promises](#ecmascript-6-promise), [ECMAScript 7 proposals](#ecmascript-7); [setImmediate](#setimmediate), [array generics](#mozilla-javascript-array-generics). Some additional features such as [dictionaries](#dict) or [extended partial application](#partial-application). You can require only standardized features polyfills, use features without global namespace pollution or create a custom build.
[Example](http://goo.gl/mfHYm2):
```javascript
Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3]
'*'.repeat(10); // => '**********'
Promise.resolve(32).then(log); // => 32
setImmediate(log, 42); // => 42
```
[Without global namespace pollution](http://goo.gl/WBhs43):
```javascript
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(core.log); // => 32
core.setImmediate(core.log, 42); // => 42
```
- [Usage](#usage)
- [Basic](#basic)
- [CommonJS](#commonjs)
- [Custom build](#custom-build)
- [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: Symbol](#ecmascript-6-symbol)
- [ECMAScript 6: Collections](#ecmascript-6-collections)
- [ECMAScript 6: Iterators](#ecmascript-6-iterators)
- [ECMAScript 6: Promise](#ecmascript-6-promise)
- [ECMAScript 6: Reflect](#ecmascript-6-reflect)
- [ECMAScript 7](#ecmascript-7)
- [Mozilla JavaScript: Array generics](#mozilla-javascript-array-generics)
- [Web standards](#web-standards)
- [setTimeout / setInterval](#settimeout--setinterval)
- [setImmediate](#setimmediate)
- [Non-standard](#non-standard)
- [Object](#object)
- [Dict](#dict)
- [Partial application](#partial-application)
- [Number Iterator](#number-iterator)
- [Escaping HTML](#escaping-html)
- [delay](#delay)
- [console](#console)
- [Missing polyfills](#missing-polyfills)
- [Changelog](#changelog)
## Usage
### Basic
```
npm i core-js
bower install core.js
```
```javascript
// 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/master/client/core.min.js), [without global namespace pollution](https://raw.githack.com/zloirock/core-js/master/client/library.min.js), [shim only](https://raw.githack.com/zloirock/core-js/master/client/shim.min.js).
Warning: if you uses `core-js` with the extension of native objects, require all needed `core-js` modules at the beginning of entry point of your application, otherwise maybe conflicts.
### CommonJS
You can require only needed modules.
```js
require('core-js/es5'); // if you need support IE8-
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 core = require('core-js/library/es5'); // if you need support IE8-
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, excluding features from [`es5`](#ecmascript-5) module (this module requires completely in ES3 environment before all other modules).
Available 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.
### Custom build
```
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`.
Available custom build from js code (required `webpack`):
```js
require('core-js/build')({
modules: ['es6', 'core.dict'], // modules / namespaces
blacklist: ['es6.reflect'], // blacklist of modules / namespaces
library: false, // flag for build without global namespace pollution
}, function(err, code){ // callback
// ...
});
```
## Features:
### ECMAScript 5
Module [`es5`](https://github.com/zloirock/core-js/blob/v1.2.1/modules/es5.js), nothing new - without examples.
```javascript
Object
.create(proto | null, descriptors?) -> object
.getPrototypeOf(object) -> proto | null
.defineProperty(target, key, desc) -> target, cap for ie8-
.defineProperties(target, descriptors) -> target, cap for ie8-
.getOwnPropertyDescriptor(object, key) -> desc
.getOwnPropertyNames(object) -> array
.keys(object) -> array
Array
.isArray(var) -> bool
#slice(start?, end?) -> array, fix for ie7-
#join(string = ',') -> string, fix for ie7-
#indexOf(var, from?) -> int
#lastIndexOf(var, from?) -> int
#every(fn(val, index, @), that) -> bool
#some(fn(val, index, @), that) -> bool
#forEach(fn(val, index, @), that) -> void
#map(fn(val, index, @), that) -> array
#filter(fn(val, index, @), that) -> array
#reduce(fn(memo, val, index, @), memo?) -> var
#reduceRight(fn(memo, val, index, @), memo?) -> var
Function
#bind(object, ...args) -> boundFn(...args)
Date
.now() -> int
#toISOString() -> string
```
Some features moved to [another modules / namespaces](#ecmascript-6), but available as part of `es5` namespace too:
```js
Object
.seal(object) -> object, cap for ie8-
.freeze(object) -> object, cap for ie8-
.preventExtensions(object) -> object, cap for ie8-
.isSealed(object) -> bool, cap for ie8-
.isFrozen(object) -> bool, cap for ie8-
.isExtensible(object) -> bool, cap for ie8-
String
#trim() -> str
```
### ECMAScript 6
#### ECMAScript 6: Object
Modules [`es6.object.assign`](https://github.com/zloirock/core-js/blob/v1.2.1/modules/es6.object.assign.js), [`es6.object.is`](https://github.com/zloirock/core-js/blob/v1.2.1/modules/
没有合适的资源?快使用搜索试试~ 我知道了~
nodejs+mssql+SQL Server实现增删改查
共1867个文件
js:1331个
md:164个
json:132个
5星 · 超过95%的资源 需积分: 49 834 下载量 163 浏览量
2015-10-10
19:33:38
上传
评论 17
收藏 1.92MB RAR 举报
温馨提示
用nodejs+mssql+SQL Server实现增删改查
资源推荐
资源详情
资源评论
收起资源包目录
nodejs+mssql+SQL Server实现增删改查 (1867个子文件)
Cakefile 624B
mssql.cmd 178B
mime.cmd 170B
main.coffee 36KB
tedious.coffee 26KB
msnodesql.coffee 12KB
tds.coffee 12KB
ipaddr.test.coffee 12KB
ipaddr.coffee 12KB
udt.coffee 4KB
benchmarks.coffee 4KB
datatypes.coffee 3KB
table.coffee 2KB
cli.coffee 2KB
query.coffee 1KB
tds-fix.coffee 884B
isolationlevel.coffee 121B
.coffeemaker 45B
style.css 111B
style.css 32B
comments.ejs 387B
rmWhitespace.ejs 353B
menu_preprocessor.ejs 251B
index.ejs 222B
menu.ejs 222B
menu_var.ejs 183B
newlines.mixed.ejs 131B
no.semicolons.ejs 131B
literal.ejs 114B
include-abspath.ejs 114B
space-and-tab-slurp.ejs 98B
include.ejs 98B
no.newlines.ejs 90B
newlines.ejs 90B
error.ejs 83B
include_preprocessor.ejs 80B
messed.ejs 72B
error.ejs 63B
include_preprocessor.css.ejs 62B
include.css.ejs 60B
consecutive-tags.ejs 47B
no.newlines.error.ejs 47B
include-simple.ejs 44B
include_preprocessor_cache.ejs 43B
double-quote.ejs 41B
item.ejs 39B
bom.ejs 35B
fail.ejs 35B
single-quote.ejs 34B
include_cache.ejs 33B
menu-item.ejs 33B
user-no-with.ejs 28B
pet.ejs 25B
user.ejs 21B
hello-world.ejs 20B
with-context.ejs 16B
para.ejs 11B
include_preprocessor.ejs 10B
renderFile.ejs 10B
include.ejs 10B
backslash.ejs 5B
.eslintignore 5B
.eslintignore 5B
update.html 847B
userinfo.html 579B
add.html 439B
rmWhitespace.html 227B
comments.html 179B
error.html 127B
literal.html 113B
menu.html 105B
menu_preprocessor.html 104B
include_preprocessor.html 81B
include.html 81B
newlines.html 78B
no.semicolons.html 75B
no.newlines.html 68B
space-and-tab-slurp.html 66B
messed.html 50B
include_preprocessor.css.html 39B
include.css.html 39B
include-simple.html 34B
double-quote.html 27B
single-quote.html 25B
newlines.mixed.html 21B
include_cache.html 11B
include_preprocessor_cache.html 11B
backslash.html 5B
consecutive-tags.html 4B
untitled2.iml 450B
Jakefile 1016B
core.js 138KB
shim.js 128KB
library.js 128KB
main.js 54KB
core.min.js 50KB
shim.min.js 46KB
library.min.js 46KB
tedious.js 42KB
connection.js 41KB
共 1867 条
- 1
- 2
- 3
- 4
- 5
- 6
- 19
娃娃1028
- 粉丝: 4
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
前往页