Skip to content

Commit

Permalink
Alternative API
Browse files Browse the repository at this point in the history
This won’t read a file synchronously on load unless that’s what the
user wants
  • Loading branch information
bfred-it committed Feb 17, 2017
1 parent b85601a commit 509117e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 18 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ The official color of the JavaScript logo
## Usage

```js
const yellow = require("javascript-yellow")

{
color: '#f7df1e',
logo: '<svg>...</svg>'
}
const yellow = require('javascript-yellow')
const logo = require('javascript-yellow/logo')

// yellow = '#f7df1e'
// logo = '<svg>...</svg>'
```
1 change: 1 addition & 0 deletions color.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = '#f7df1e';
7 changes: 3 additions & 4 deletions example.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const yellow = require('.')
const logo = require('./logo')

{
color: '#f7df1e',
logo: '<svg>...</svg>'
}
// yellow = '#f7df1e'
// logo = '<svg>...</svg>'
7 changes: 0 additions & 7 deletions index.js

This file was deleted.

4 changes: 4 additions & 0 deletions logo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var fs = require('fs')
var path = require('path')

module.exports = fs.readFileSync(path.join(__dirname, 'js.svg'), 'utf-8');
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "javascript-yellow",
"version": "1.0.2",
"description": "The official color of the JavaScript logo",
"main": "index.js",
"main": "color.js",
"repository": "https://github.com/zeke/javascript-yellow",
"keywords": [
"javascript",
Expand Down

0 comments on commit 509117e

Please sign in to comment.