Skip to content

Commit f6c06da

Browse files
committed
Added gitignore file and Updated README
1 parent 8b96b64 commit f6c06da

12 files changed

+156
-115
lines changed

.DS_Store

6 KB
Binary file not shown.

.gitignore

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
2+
# Logs
3+
logs
4+
*.log
5+
npm-debug.log*
6+
yarn-debug.log*
7+
yarn-error.log*
8+
9+
# Runtime data
10+
pids
11+
*.pid
12+
*.seed
13+
*.pid.lock
14+
15+
# Directory for instrumented libs generated by jscoverage/JSCover
16+
lib-cov
17+
18+
# Coverage directory used by tools like istanbul
19+
coverage
20+
21+
# nyc test coverage
22+
.nyc_output
23+
24+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
25+
.grunt
26+
27+
# Bower dependency directory (https://bower.io/)
28+
bower_components
29+
30+
# node-waf configuration
31+
.lock-wscript
32+
33+
# Compiled binary addons (https://nodejs.org/api/addons.html)
34+
build/Release
35+
36+
# Dependency directories
37+
node_modules/
38+
jspm_packages/
39+
40+
# Typescript v1 declaration files
41+
typings/
42+
43+
# Optional npm cache directory
44+
.npm
45+
46+
# Optional eslint cache
47+
.eslintcache
48+
49+
# Optional REPL history
50+
.node_repl_history
51+
52+
# Output of 'npm pack'
53+
*.tgz
54+
55+
# Yarn Integrity file
56+
.yarn-integrity
57+
58+
# dotenv environment variables file
59+
.env
60+
61+
# next.js build output
62+
.next
63+
64+
package-lock.json

.idea/jsLibraryMappings.xml

-6
This file was deleted.

.idea/modules.xml

-8
This file was deleted.

.idea/symbol-es6.iml

-12
This file was deleted.

.idea/vcs.xml

-6
This file was deleted.

README.md

+74-66
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,42 @@
1+
[![NPM version](https://img.shields.io/npm/v/symbol-es6.svg)](https://www.npmjs.com/package/symbol-es6)
2+
[![NPM total downloads](https://img.shields.io/npm/dt/symbol-es6.svg)](https://www.npmjs.com/package/symbol-es6)
3+
[![Contributors](https://img.shields.io/github/contributors/rousan/symbol-es6.svg)](https://github.com/rousan/symbol-es6/graphs/contributors)
4+
[![License](https://img.shields.io/github/license/rousan/symbol-es6.svg)](https://github.com/rousan/symbol-es6/blob/master/LICENSE)
5+
16
# Symbol-ES6
27

3-
Provides support for Symbol API of ES6 in ES5 for older JS environments i.e. older browsers or NodeJS.
4-
To get full implementations of ES6 in ES5, install [es6-harmony](https://github.com/ariyankhan/es6-harmony) module.
8+
Provides support for `ES6` Symbol API in `ES5` for older JS environments i.e. older browsers or NodeJS.
59

6-
## Polyfills
10+
> ES6 Symbol polyfill in pure ES5.
711
8-
* `Symbol`
9-
* `for()`
10-
* `keyFor`
11-
* `@@hasInstance`
12-
* `@@isConcatSpreadable`
13-
* `@@iterator`
14-
* `@@toStringTag`
15-
* `Symbol.prototype.toString()`
16-
* `Symbol.prototype.valueOf()`
17-
18-
* `Function`
19-
* `Function.prototype[@@hasInstance]()`
20-
21-
* `Array`
22-
* `Array.prototype.concat()` (ES6 version, addition of `@@isConcatSpreadable` support)
23-
* `Array.prototype[@@iterator]()`
24-
* `Array.from()`
25-
* `Array.prototype.entries()`
26-
* `Array.prototype.keys()`
12+
## Install
2713

28-
* `Object`
29-
* `Object.prototype.toString()` (ES6 version, addition of `@@toStringTag` support)
14+
### NPM
3015

31-
* `String`
32-
* `String.prototype[@@iterator]()`
33-
34-
## Limitation
16+
Install it from `npm` and `require` it before any other modules:
3517

36-
Some ES6 features can't be implemented in ES5 natively like `spread operator`, `for..of` loop,
37-
ES6 version of `instanceOf` operator etc. So this module exports a object named `ES6` globally,
38-
that provides some approximate equivalent implementation of those features.
18+
```bash
19+
$ npm install --save symbol-es6
20+
```
3921

40-
## `ES6` Object
22+
```javascript
23+
require("symbol-es6");
24+
```
4125

42-
This object provides,
26+
### CDN
4327

44-
* `isSymbol()` (It can be used as equivalent API of: `typeof symbol === 'symbol'`)
45-
* `instanceOf()` (Provides ES6 version of `instanceOf`)
46-
* `forOf()` (This method behaves exactly same as ES6 `for...of` loop)
47-
* `spreadOperator` (Gives same functionality of the `spread operator` of ES6)
28+
If you prefer CDN, then just insert it into your HTML page on the top of other scripts:
29+
30+
```html
31+
<script src="https://cdn.jsdelivr.net/npm/symbol-es6/dist/symbol-es6.min.js"></script>
32+
```
4833

49-
5034
## Examples
5135

5236
```javascript
5337
"use strict";
5438

55-
require("symbol-es6");
39+
var ES6 = require("symbol-es6");
5640

5741
console.log(Symbol("bar") === Symbol("bar")); //false
5842

@@ -131,42 +115,66 @@ function Student(name, roll) {
131115
console.log(ES6.spreadOperator(Student).spread(["Ariyan", 10]).new().name); //Ariyan
132116
```
133117

134-
## Installation
118+
## Polyfills
135119

136-
* In browser context, just insert this script on the top of other scripts
137-
* For NodeJS, just install it from npm
120+
* `Symbol`
121+
* `for()`
122+
* `keyFor`
123+
* `@@hasInstance`
124+
* `@@isConcatSpreadable`
125+
* `@@iterator`
126+
* `@@toStringTag`
127+
* `Symbol.prototype.toString()`
128+
* `Symbol.prototype.valueOf()`
129+
130+
* `Function`
131+
* `Function.prototype[@@hasInstance]()`
132+
133+
* `Array`
134+
* `Array.prototype.concat()` (ES6 version, addition of `@@isConcatSpreadable` support)
135+
* `Array.prototype[@@iterator]()`
136+
* `Array.from()`
137+
* `Array.prototype.entries()`
138+
* `Array.prototype.keys()`
138139

139-
`npm install symbol-es6`
140+
* `Object`
141+
* `Object.prototype.toString()` (ES6 version, addition of `@@toStringTag` support)
140142

141-
## Testing
143+
* `String`
144+
* `String.prototype[@@iterator]()`
142145

143-
`npm test`
144-
145-
## Contributors
146146

147-
* [Rousan Ali](https://github.com/ariyankhan)
147+
## Limitation
148+
149+
Some `ES6` features can't be implemented in `ES5` natively like `spread operator`, `for..of` loop,
150+
`ES6` version of `instanceOf` operator etc. So this module exports a object named `ES6` globally,
151+
that provides some approximate equivalent implementation of those features.
152+
153+
## `ES6` Object
148154

149-
## License
155+
This object provides,
150156

151-
MIT License
157+
* `isSymbol()` (It can be used as equivalent API of: `typeof symbol === 'symbol'`)
158+
* `instanceOf()` (Provides ES6 version of `instanceOf`)
159+
* `forOf()` (This method behaves exactly same as ES6 `for...of` loop)
160+
* `spreadOperator` (Gives same functionality of the `spread operator` of ES6)
152161

153-
Copyright (c) 2017 Rousan Ali
162+
## Contributing
154163

155-
Permission is hereby granted, free of charge, to any person obtaining a copy
156-
of this software and associated documentation files (the "Software"), to deal
157-
in the Software without restriction, including without limitation the rights
158-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
159-
copies of the Software, and to permit persons to whom the Software is
160-
furnished to do so, subject to the following conditions:
164+
Your PRs and stars are always welcome.
161165

162-
The above copyright notice and this permission notice shall be included in all
163-
copies or substantial portions of the Software.
166+
Please, try to follow:
164167

165-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
166-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
167-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
168-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
169-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
170-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
171-
SOFTWARE.
168+
* Clone the repository.
169+
* Checkout `develop` branch.
170+
* Install dependencies.
171+
* Add your new features or fixes.
172+
* Build the project.
172173

174+
```sh
175+
$ git clone https://github.com/rousan/symbol-es6.git
176+
$ cd symbol-es6
177+
$ git checkout develop
178+
$ npm i
179+
$ npm run build
180+
```

dist/symbol-es6.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/symbol-es6.min.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
{
22
"name": "symbol-es6",
3-
"version": "0.1.1",
4-
"description": "Provides Symbol implementation of ES6 in pure ES5 for older browsers and JS engines",
3+
"version": "0.1.2",
4+
"description": "ES6 Symbol polyfill in pure ES5",
55
"main": "symbol-es6.js",
6-
"directories": {
7-
"test": "test"
8-
},
96
"scripts": {
7+
"build": "uglifyjs --source-map --compress --output dist/symbol-es6.min.js -- symbol-es6.js",
108
"test": "node ./test/test.js"
119
},
1210
"repository": {
1311
"type": "git",
14-
"url": "git+https://github.com/ariyankhan/symbol-es6.git"
12+
"url": "git+https://github.com/rousan/symbol-es6.git"
1513
},
1614
"keywords": [
1715
"es",
@@ -27,10 +25,13 @@
2725
"js-symbol",
2826
"es-symbol"
2927
],
30-
"author": "Ariyan Khan",
28+
"author": "Rousan Ali <rousanali786@gmail.com> (https://rousan.io)",
3129
"license": "MIT",
3230
"bugs": {
33-
"url": "https://github.com/ariyankhan/symbol-es6/issues"
31+
"url": "https://github.com/rousan/symbol-es6/issues"
3432
},
35-
"homepage": "https://github.com/ariyankhan/symbol-es6#readme"
33+
"homepage": "https://github.com/rousan/symbol-es6#readme",
34+
"devDependencies": {
35+
"uglify-js": "^3.3.9"
36+
}
3637
}

symbol-es6.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
/*!
2-
* Symbol-ES6 v0.1.1
3-
* Provides Symbol implementation of ES6 in pure ES5 for older browsers
4-
* and JS engines.
2+
* Symbol-ES6 v0.1.2
3+
* ES6 Symbol polyfill in pure ES5.
54
*
6-
* @license Copyright (c) 2017 Ariyan Khan, MIT License
5+
* @license Copyright (c) 2017-2018 Rousan Ali, MIT License
76
*
8-
* Codebase: https://github.com/ariyankhan/symbol-es6
9-
* Date: Jun 14, 2017
7+
* Codebase: https://github.com/rousan/symbol-es6
8+
* Date: 28th Jan, 2018
109
*/
1110

1211
(function (global, factory) {

test/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22

3-
require("../symbol-es6");
3+
var ES6 = require("../symbol-es6");
44

55
console.log(Symbol("bar") === Symbol("bar")); //false
66

0 commit comments

Comments
 (0)