1.0.1 • Published 7 years ago

nfm-api v1.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

NFM API

Simple bindings for the USDA National Farmers Market Directory API

Usage

Firstly, npm install nfm-api

The API supports searching the directory via:
- Zip code
- Latitude / Longitude
- Market ID

Be sure to require the module const nfmapi = require('nfm-api')

Using promises:

nfmapi.zipSearch(90210)   
	.then(data => {   
		...   
	})
	.catch(err => {   
		console.log(err)    
	})
	
nfmapi.locationSearch(34.103003, -118.410468)
	.then(data => {
		...
	})
	.catch(err => {
		console.log(err)
	})
	
nfmapi.mktDetailSearch(1001460)
	.then(data => {   
		...   
	})
	.catch(err => {   
		console.log(err)    
	})

Using callbacks:

nfmapi.zipSearch(90210, data => {
	...
})

nfmapi.locationSearch(34.103003, -118.410468, data => {
	...	
})

nfmapi.mktDetailSearch(1001460, data => {
	...	
})
1.0.1

7 years ago

1.0.0

7 years ago