1.1.0 • Published 5 years ago

real-random-address v1.1.0

Weekly downloads
30
License
MIT
Repository
github
Last release
5 years ago

Real random address generator

NpmVersion NpmLicense

Real random address is a OpenStreet based generator, NodeJS library. Create address.json in root your project.

Installation

npm i real-random-address

How to use?

Step 1. Create the rrag.js file with the following code:

const rrag = require('real-random-address');
rrag.random(); // => address.json  Get random cities from list!

// Countries
rrag.uk();
rrag.de();
rrag.fr();
rrag.it();
rrag.pl();
rrag.ua();
rrag.nl();

//Language options. Look 'Accept-Language'
rrag.random("en");
rrag.de("us");
rrag.pl("ru");

Step 2. Create yourApp.js file with the following code:

const fs = require('fs')

// For read address.json
fs.readFile('address.json', (err,data)=>{

   // 1 example
   console.log(
       JSON.parse(data)
   )

   // 2 example
   let address = JSON.parse(data);
   console.log(`
   Country: ${address.country} - code ${address.short};
   State: ${address.state};
   City: ${address.city};
   Street: ${address.street};
   Number: ${address.number};
   Zip: ${address.zip}.
   `)

})

Step 3. In package.json create line:

...
"scripts": {
   "get-address-example": "node rrag.js && node yourApp.js"
 },
...

Step 4. Run script in terminal:

npm run get-address-example

Available countries:

  • United Kingdom
  • Germany
  • France
  • Italy
  • Poland
  • Ukraine
  • Netherlands

Available cities:

  • In random: Amsterdam Bari Berlin Birmingham Dusselldorf Elblag Enschede Firenze Frankfurn Gdansk Krakow Leeds Leipzig Liverpool London London Lubline Lyon Madrid Manchester Mannheim Marseille Milan Milano Napoli Newcastle Poznan Preston Radom Rennes Rome Rotterdam Stambul Stuttgart Tourine Venezia Warszawa Wroclaw
1.1.0

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago