mog-script

0.2.4 • Public • Published

M.O.G. Script

Installation 💾

npm install -g mog-script

Usage 🍴

Say you have a M.O.G. file named 🍧.💎 that contains:

💎 { createStore } = require('redux')
 
💎 reducer = ⚙ (state, action) { 
  🚦 (action.type) {
    💼 'INCREMENT': 
      🎁 state + action.payload
     
    💼 'DECREMENT': 
      🎁 state - action.payload
  }
}
 
💎 initialState = 0
 
💎 store = createStore(reducer, initialState)
 
store.subscribe( () { console.log(`New value is ${store.getState()}`) }
 
process.stdin.on('data', ⚙ (chunk) {
  ❓ (chunk[0] === '-') {
    store.dispatch({ type: 'DECREMENT', payload: chunk.slice(1) })
  } ❗️ {
    store.dispatch({ type: 'INCREMENT', payload: chunk })
  }
})

You can run it with:

💎 🍧.💎

🚄

Readme

Keywords

none

Package Sidebar

Install

npm i mog-script

Weekly Downloads

1

Version

0.2.4

License

MIT

Last publish

Collaborators

  • npejo