Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

maniolias/cp-ville-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#cp-ville-node

Petite implémentation de l'API cp-ville pour node.js.

##Installation

npm install cp-ville-node --save

##Utilisation de l'API

var cpVille = require('cp-ville-node');

cpVille.find("69005",function(err,data)
{
	if(err) console.log(err)
	else
		console.log(data)

	/*
	*{ '1': { ville: 'LYON', cp: '69009' },
	*count: 1,
	*typeretour: 'ville' }
	*/

})

cpVille.find("pomp",function(err,data)
{
	if(err) console.log(err)
	else
		console.log(data.toArray("cp"))

	/*
	*[ { cp: '19230' },
	*{ cp: '24240' },
	*{ cp: '24170' },
	*{ cp: '25340' },
	*{ cp: '30170' },
	*{ cp: '31450' },
	*{ cp: '32130' },
	*{ cp: '33730' },
	*{ cp: '33370' },
	*{ cp: '47230' },
	*{ cp: '47420' },
	*{ cp: '48110' },
	*{ cp: '54340' },
	*{ cp: '64370' },
	*{ cp: '77400' },
	*{ cp: '79200' },
	*{ cp: '79160' },
	*{ cp: '82170' },
	*{ cp: '88300' },
	*{ cp: '97316' } ]
	*/
})

About

Implémentation de l'API cp-ville.com pour node.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published