Find Swiss canton by it's abbreviation or name. (This is a port of php-swiss-cantons)
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
In order to work on this package you should have
ava installed globally.
git clone https://github.com/stefanzweifel/js-swiss-cantons.git
You should install the package with
npm in your project.
npm install @stefanzweifel/js-swiss-cantons
Currently there two methods available on the CantonManager Class:
import CantonManager from '@stefanzweifel/js-swiss-cantons'; let manager = new CantonManager; let canton = manager.getByAbbreviation('SH'); let canton = manager.getByName('Schaffhausen'); console.log( canton.setLanguage('de').getName(), // Schaffhausen );
End with an example of getting some data out of the system or using it for a little demo
Running the tests
Tests are written with ava.
npm run test
npm update patch | minor | major npm publish
- Stefan Zweifel - Initial work - stefanzweifel
See also the list of contributors who participated in this project.