Skip to content

Commit

Permalink
🔨 just export a function
Browse files Browse the repository at this point in the history
The whole goal of this package is to do one thing… Let’s just export
the function instead of an object
  • Loading branch information
blakek committed Mar 22, 2019
1 parent 11031fb commit 960fca0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Takes a geolocation and returns the nearest US ZIP code.
Get the nearest ZIP to a location:

```js
const { geo2zip } = require('geo2zip')
const geo2zip = require('geo2zip')

const somewhere = {
latitude: 34.659698,
Expand Down
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ function geo2zip (rawLocation) {
return Promise.resolve(lookup(latitude, longitude, 1)[0].zipCode)
}

module.exports = {
geo2zip
}
module.exports = geo2zip
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import test from 'ava'
import { geo2zip } from '.'
import geo2zip from '.'

test('returns zip code from same geolocation', async t => {
const exactly38873 = {
Expand Down

0 comments on commit 960fca0

Please sign in to comment.