Skip to content

Commit

Permalink
OK
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Apr 3, 2018
0 parents commit df4d583
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 0 deletions.
12 changes: 12 additions & 0 deletions data/concepts
@@ -0,0 +1,12 @@
middleware
requests
responses
helpers
views
routes
apps
templates
static files
tests
models
controllers
25 changes: 25 additions & 0 deletions data/language-features
@@ -0,0 +1,25 @@
default parameters
template literals
destructuring assignment
arrow functions
promises
block-scoped variable declarations
classes
modules
async/await
decorators
the exponent operator
String.prototype.padStart
symbols
object spread
observables
Object.values
generators
getters and setters
WeakMap
proxies
dynamic import
pattern matching
partial application
closures
hoisting
28 changes: 28 additions & 0 deletions index.js
@@ -0,0 +1,28 @@
#!/usr/bin/env node

const {
resolve
} = require('path')

const fs = require('fs')

const {
promisify
} = require('util')

const readFile = promisify(fs.readFile)

const conceptsFile = resolve(__dirname, 'data', 'concepts')
const languageFeaturesFile = resolve(__dirname, 'data', 'language-features')

const getRandomLine = filename => readFile(filename)
.then(buffer => buffer.toString())
.then(file => file.split('\n'))
.then(lines => lines[Math.floor(Math.random() * (lines.length - 1))])

const concept = getRandomLine(conceptsFile)
const feature = getRandomLine(languageFeaturesFile)

Promise.all([concept, feature])
.then(([concept, feature]) =>
console.log(`let's replace all our ${concept} with ${feature}`))
12 changes: 12 additions & 0 deletions package.json
@@ -0,0 +1,12 @@
{
"name": "luka",
"version": "1.0.3",
"description": "generate good advice for building future-proof web applications",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "chee <chee@snake.dog> (https://snaek.org/)",
"license": "GPL-3.0+",
"bin": "index.js"
}

0 comments on commit df4d583

Please sign in to comment.