Expressing styles in JavaScript isn't all that different than expressing them in css.
Imagine you had the following css and html:
| import slack from `slack` | |
| let token = process.env.SLACK_TOKEN | |
| let bot = slack.rtm.client({token}) | |
| bot.on("hello", console.log) | |
| bot.on("message", console.log) |
| "use strict"; | |
| var SimplePassport = { | |
| authenticate: function(req, res, strategy, options, callback) { | |
| strategy = Object.create(strategy); | |
| Object.assign(strategy, { | |
| success: callback.bind(null, null), // callback(null, user) | |
| error: callback.bind(null), // callback(err) | |
| fail: callback.bind(null, null, false), // callback(null, false) | |
| pass: callback.bind(null, null, null), // callback(null, null) |
| $ browserify --version | |
| 11.2.0 | |
| $ echo "Buffer.isBuffer(null)" > buffer-test.js | |
| $ browserify buffer-test.js | |
| (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
| (function (Buffer){ | |
| Buffer.isBuffer(null) | |
| }).call(this,{"isBuffer":require("/home/parshap/projects/node-browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js")}) | |
| },{"/home/parshap/projects/node-browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js":2}],2:[function(require,module,exports){ |
| }).call(this,{"isBuffer":require("/path/to/project/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js")}) | |
| },{"/path/to/project/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js":553}],598:[function(require,module,exports){ |
| SyntaxError: Unexpected token (115:27) while parsing file: /home/parshap/projects/aboutlife/web/lib/client/react/employee-card.js | |
| at Parser.pp.raise (/home/parshap/projects/aboutlife/web/node_modules/acorn/dist/acorn.js:1745:13) | |
| at Parser.pp.unexpected (/home/parshap/projects/aboutlife/web/node_modules/acorn/dist/acorn.js:2264:8) | |
| at Parser.pp.expect (/home/parshap/projects/aboutlife/web/node_modules/acorn/dist/acorn.js:2258:26) | |
| at Parser.pp.parseExprList (/home/parshap/projects/aboutlife/web/node_modules/acorn/dist/acorn.js:1443:12) | |
| at Parser.pp.parseExprAtom (/home/parshap/projects/aboutlife/web/node_modules/acorn/dist/acorn.js:1120:28) | |
| at Parser.pp.parseExprSubscripts (/home/parshap/projects/aboutlife/web/node_modules/acorn/dist/acorn.js:1023:19) | |
| at Parser.pp.parseMaybeUnary (/home/parshap/projects/aboutlife/web/node_modules/acorn/dist/acorn.js:1004:19) | |
| at Parser.pp.parseExprOps (/home/parshap/projects/aboutlife/web/node_modules/acorn/dist/acorn.js:948:19) | |
| at Parser.pp.parseMaybeConditiona |
| #!/bin/bash | |
| logfile=$1 | |
| pidfile=$2 | |
| sighup() { | |
| exec 0>>$logfile 2>&1 | |
| } | |
| echo "$$" > $pidfile |
| "use strict"; | |
| // # Responsive Component | |
| // | |
| // A react component that will conditionally render children that correspond | |
| // to the currently matching "named" media query. | |
| // | |
| // The predefined named media queries are: "small", "not-small", "medium", and | |
| // "large". These correspond to CSS classes that end with "-ns", "-m", etc. | |
| // suffixes. |
| [email protected] /usr/lib/node_modules/requiresafe | |
| ├── [email protected] | |
| ├── [email protected] | |
| ├── [email protected] | |
| ├── [email protected] | |
| ├── [email protected] | |
| ├── [email protected] | |
| ├── [email protected] | |
| ├── [email protected] ([email protected]) | |
| ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) |
| Warning: distutils distribution has been initialized, it may be too late to add a library RWarning: distutils distribution has been initialized, it may be too late to add a library blasWarning: distutils distribution has been initialized, it may be too late to add an extension _earthTraceback (most recent call last): | |
| File "setup.py", line 62, in <module> | |
| 'lifeline-admin=lifeline.admin.main:LifelineAdmin.main' | |
| File "/usr/lib/python2.7/distutils/core.py", line 151, in setup | |
| dist.run_commands() | |
| File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands | |
| self.run_command(cmd) | |
| File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command | |
| cmd_obj.run() | |
| File "/src/local/lib/python2.7/site-packages/setuptools/command/develop.py", line 27, in run |