Comments (14)
I don't see the need for this, for now. This repository simply contains data and has no (JavaScript) features, so it would made no sense to create a node.js package for this. I think you should use what git provides to keep up with the changes.
from countries.
Good idea. So using git submodule is even smarter. Thanks
from countries.
You're welcome!
from countries.
You can NPM and Bower install from a Git repo.
From there you can write a simple lib to parse the json (or whatever you like) into your application and require it like normal.
You can manage versions and deployment in this way if you would like.
from countries.
@tonytamps it's not currently possible to do this via npm
without having a package.json
. I personally don't see any issue in publishing to npm at all. @mledoze, could you please review this issue again?
Take a look at the package from substack which does something similar. https://github.com/substack/provinces (npm module).
from countries.
Yes, you can. https://coderwall.com/p/_bbeda
from countries.
@tonytamps you can install a package from github (or any other git repo for that matter), but it needs to have a package.json
available as mentioned on my previous comment.
From [https://www.npmjs.org/doc/cli/npm-install.html](npm-install docs):
A package is:
a) a folder containing a program described by a package.json file
b) a gzipped tarball containing (a)
g) a <git remote url> that resolves to (b)
from countries.
@ruimarinho you are right but why do you need a npm package? Is it to manage versions and updates?
Doing var countries = require('countries.json');
will give you an array of objects which you can easily manipulate.
from countries.
I'm using the list of countries on the https://github.com/seegno/co-authy node.js client, but the data itself has been versioned on that repository. If I could npm install countries
, then I wouldn't need that, in addition to keep up-to-date with the latest version simply by updating the package version.
from countries.
@ruimarinho here it is https://www.npmjs.org/package/world-countries (in f915449)
from countries.
@mledoze thank you so much! Appreciated.
from countries.
You're welcome! I hope this will facilitate the use of this dataset.
As you can see this is the first module I publish, do not hesitate to come back to me if something is wrong.
from countries.
Everything worked perfectly @mledoze. ruimarinho/co-authy@7027161 I think it will be very popular on npm :)
from countries.
I think it will be very popular on npm
I very much hope so!
from countries.
Related Issues (20)
- Barbedos missing HOT 1
- 4.1.0 on npm HOT 4
- New release HOT 6
- ERROR: Package path ./data is not exported from package HOT 3
- Warning when using npm package HOT 9
- Error when yarn build HOT 4
- Fix the number of columns in CSV export
- a TypeScript syntax issue in the world-countries package HOT 2
- export { default } from './countries.json' assert { type: 'json' }; HOT 4
- 'convert -i name' instead of '-i=name' in README.md HOT 1
- Some nationality/demonym spellings do not match with UK government's ones
- Important Improvements HOT 2
- Add EEA (European Economic Area) countries
- Add Chinese Taipei flag
- Add cities
- Turkey country name changed to Türkiye HOT 1
- How to access state of certain country?
- Kazakhstan Capital renamed back to Astana as of September 2022 HOT 1
- Kosovo is missing HOT 1
- Move composer's `ext-gettext` PHP module to 'require-dev' key
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from countries.