Giter Site home page Giter Site logo

Comments (14)

mledoze avatar mledoze commented on August 15, 2024

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.

Nomeasmo avatar Nomeasmo commented on August 15, 2024

Good idea. So using git submodule is even smarter. Thanks

from countries.

mledoze avatar mledoze commented on August 15, 2024

You're welcome!

from countries.

tonytamps avatar tonytamps commented on August 15, 2024

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.

ruimarinho avatar ruimarinho commented on August 15, 2024

@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.

tonytamps avatar tonytamps commented on August 15, 2024

Yes, you can. https://coderwall.com/p/_bbeda

from countries.

ruimarinho avatar ruimarinho commented on August 15, 2024

@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.

mledoze avatar mledoze commented on August 15, 2024

@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.

ruimarinho avatar ruimarinho commented on August 15, 2024

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.

mledoze avatar mledoze commented on August 15, 2024

@ruimarinho here it is https://www.npmjs.org/package/world-countries (in f915449)

from countries.

ruimarinho avatar ruimarinho commented on August 15, 2024

@mledoze thank you so much! Appreciated.

from countries.

mledoze avatar mledoze commented on August 15, 2024

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.

ruimarinho avatar ruimarinho commented on August 15, 2024

Everything worked perfectly @mledoze. ruimarinho/co-authy@7027161 I think it will be very popular on npm :)

from countries.

mledoze avatar mledoze commented on August 15, 2024

@ruimarinho

I think it will be very popular on npm

I very much hope so!

from countries.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.