Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@shagital/adonisjs-location
Advanced tools
Adonisjs (Nodejs) package that provides simple way to get Countries, Cities and States that you may need for your Application, most especially for dropdown menus.
This Package offers a simple way to get Countries, Cities and States that you may need for your Application, most especially for dropdown menus.
adonis install @shagital/adonisjs-location
// via npm
npm require @shagital/adonisjs-location
// via yarn
yarn add @shagital/adonisjs-location
adonis run:instructions node_modules/@shagital/adonisjs-location
adonisjs-location
provides you with an easy way of customizing the tables used for storing Countries, States and Cities. Also, you can customise the route prefix. To customize these you need to update the
configuration file config/location.js
available for you to edit. The default configurations are:
module.exports = {
countries_table : 'countries',
cities_table : 'cities',
states_table : 'states',
routes : {
prefix : 'location'
}
};
You can go ahead and customize the table names
, and route prefix
as you need before running the Migration.
before you do this make sure your correct Database credentials are set in the
.env
file
// if adonis CLI is installed globally
adonis migration:run
// using ace
node ace migration:run
Finally, run the Package seeders
adonis seed --files=database/seeds/1_CountrySeeder.js,database/seeds/2_StateSeeder.js,database/seeds/3_CitySeeder.js
// using ace
node ace seed --files=database/seeds/1_CountrySeeder.js,database/seeds/2_StateSeeder.js,database/seeds/3_CitySeeder.js
NOTE
The routes below are prefixed withlocation
which is the default configuration set in theconfig/location.js
file. If modified, replace the prefix in your route with the correct prefix.
Route | Description |
---|---|
/location/countries | return all countries |
/location/countries/{id} | return a single country by its ID, with states |
/location/countries/{id}/states | return all states by country ID |
/location/countries/{id}/cities | return all cities by country ID |
/location/states/{id}/cities | return all cities by state ID |
// via npm
npm run test
// via yarn
yarn test
Free for all, if you find an issue with the package or notice a missing country, state or city, please send in a PR.
This package was influenced by laravel-location package
FAQs
Adonisjs (Nodejs) package that provides simple way to get Countries, Cities and States that you may need for your Application, most especially for dropdown menus.
The npm package @shagital/adonisjs-location receives a total of 0 weekly downloads. As such, @shagital/adonisjs-location popularity was classified as not popular.
We found that @shagital/adonisjs-location demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.