Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jpwilliams/essupernext
ES2018 a.k.a. "ESSuper-Next". Dot-syntax and keyword conversion.
https://github.com/jpwilliams/essupernext
ecmascript ecmascript2018 es2018 essupernext supernext
Last synced: 22 days ago
JSON representation
ES2018 a.k.a. "ESSuper-Next". Dot-syntax and keyword conversion.
- Host: GitHub
- URL: https://github.com/jpwilliams/essupernext
- Owner: jpwilliams
- License: mit
- Created: 2017-04-05T14:15:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-05T15:23:34.000Z (over 7 years ago)
- Last Synced: 2024-10-04T09:50:35.139Z (about 1 month ago)
- Topics: ecmascript, ecmascript2018, es2018, essupernext, supernext
- Language: JavaScript
- Size: 4.88 KB
- Stars: 13
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# essupernext
![Build Status](https://img.shields.io/badge/build-passing-brightgreen.svg)
![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen.svg)
![Downloads](https://img.shields.io/badge/downloads-319k/month-brightgreen.svg)
![https://npmjs.com/package/essupernext](https://img.shields.io/npm/v/essupernext.svg)
[![Month](https://img.shields.io/badge/month-april-ff69b4.svg)](https://en.wikipedia.org/wiki/April_Fools%27_Day)ES2018 a.k.a. "ESSuper-Next". Dot-syntax and keyword conversion.
[![ES2018 First Look - it changes everything](http://i.imgur.com/Nr4MYev.png)](https://youtu.be/s-G_RZ4RJLU "ES2018 First Look - it changes everything")
Handy DIY compiler for dot syntax to get your code ready for ES2018.
### Usage
``` js
npm install -g essupernext
essupernext index.js
```### Example output
(_GitHub, stupidly, doesn't support proper highlighting for ES2018, so this will look off. Still tonnes more readable though!_)
``` js
c joi . require.'joi'.
c commentsDb . require.'connection-mongo'..'comments'.
c ObjectId . require.'connection-mongo'..ObjectId
c remit . require.'connection-remit'.
c log . require.'connection-logger'.
c validate . require.'service-helpers'..remit. log..validatem.exports . .. .. .
remit.res.'comments.create'. .
validate.joi.object...keys..
user: joi.string...trim...regex./^.0-9a-fA-F..24.$/..required...
content: joi.string...trim...regex./^.0-9a-fA-F..24.$/..
task: joi.string...trim...regex./^.0-9a-fA-F..24.$/..
comment: joi.string...trim...required..
...xor.'content'. 'task'...createComment
..
.f createComment .args. done. .
l doc . .
user: ObjectId.args.parsed.user..
comment: args.parsed.comment
.if .args.parsed.content. .
doc.content . ObjectId.args.parsed.content.
. else .
doc.task . ObjectId.args.parsed.task.
.commentsDb
.collection.'comments'.
.insertOne.doc. .err. result. .. .
if .err. .
log.error.new E.err..r done.err.
.if .result.insertedCount. .
remit.emit.'comments.created'. result.ops.0..
.r done.null. result.ops.0..
..
.
```