Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lacymorrow committed Nov 29, 2022
1 parent 755f166 commit f966576
Show file tree
Hide file tree
Showing 6 changed files with 1,860 additions and 18 deletions.
26 changes: 25 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
.fuse*
.DS*

package-lock.json
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# Deployed apps should consider commenting this line out:
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
node_modules
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
if ( typeof define === 'function' && define.amd ) {

// AMD
define( ['fetch'], cx )
define( ['isomorphic-fetch'], cx )

} else if ( typeof exports === 'object' ) {

// Node, CommonJS-like
module.exports = cx( require( 'node-fetch' ) )
module.exports = cx( require( 'isomorphic-fetch' ) )

} else {

Expand Down
29 changes: 20 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,27 @@
"description": "Fetch art for a movie or tv show: 'Oceans Eleven' ➔ http://path/to/oceans_eleven_poster.jpg",
"license": "MIT",
"repository": "lacymorrow/movie-art",
"main": "index.js",
"browser": "index.js",
"bin": {
"movie-art": "cli.js"
},
"author": {
"name": "Lacy Morrow",
"email": "me@lacymorrow.com",
"url": "http://lacymorrow.com"
},
"funding": [
{
"type": "patreon",
"url": "https://patreon.com/lacymorrow"
},
{
"type": "individual",
"url": "http://lacymorrow.com/donate"
},
"https://www.buymeacoffee.com/lm"
],
"main": "index.js",
"browser": "index.js",
"bin": {
"movie-art": "cli.js"
},
"engines": {
"node": ">=0.10.0"
},
Expand All @@ -36,11 +47,11 @@
"path"
],
"devDependencies": {
"ava": "^0.25.0",
"eslint": "^4.18.1"
"ava": "^5.1.0",
"eslint": "^8.28.0"
},
"dependencies": {
"meow": "^4.0.0",
"node-fetch": "^2.0.0"
"isomorphic-fetch": "^3.0.0",
"meow": "^4.0.0"
}
}
10 changes: 4 additions & 6 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'
import test from 'ava'
import movieArt from './index'
const test = require( 'ava' )
const movieArt = require( './index' )

test( 'returns a url', async t => {

Expand Down Expand Up @@ -57,15 +57,13 @@ test( 'fetch backdrop and poster', async t => {

} )

test.cb( 'callback returns a url', t => {
test( 'callback returns a url', async t => {

t.plan( 1 )

movieArt( 'crash', ( err, res ) => {
await movieArt( 'crash', ( _err, res ) => {

err && t.end( err )
t.is( res.indexOf( 'http' ), 0, 'response is a URL' )
t.end()

} )

Expand Down
Loading

0 comments on commit f966576

Please sign in to comment.