New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

essupernext

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

essupernext

ES2018 a.k.a. "ESSuper-Next". Dot-syntax and keyword conversion.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by66.67%
Maintainers
1
Weekly downloads
 
Created
Source

essupernext

Build Status Coverage Downloads https://npmjs.com/package/essupernext Month

ES2018 a.k.a. "ESSuper-Next". Dot-syntax and keyword conversion.

ES2018 First Look - it changes everything

Handy DIY compiler for dot syntax to get your code ready for ES2018.

Usage

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!)

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..validate

m.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..
    ..
.

Keywords

FAQs

Package last updated on 05 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc