{"id":13625646,"url":"https://github.com/juliangruber/npmd","last_synced_at":"2025-04-16T10:32:41.529Z","repository":{"id":17251267,"uuid":"20020648","full_name":"juliangruber/npmd","owner":"juliangruber","description":null,"archived":false,"fork":true,"pushed_at":"2014-06-20T06:18:03.000Z","size":332,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-01T22:05:49.243Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"dominictarr/npmd","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juliangruber.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-21T12:39:29.000Z","updated_at":"2021-01-13T19:42:04.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/juliangruber/npmd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliangruber%2Fnpmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliangruber%2Fnpmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliangruber%2Fnpmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliangruber%2Fnpmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juliangruber","download_url":"https://codeload.github.com/juliangruber/npmd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223708285,"owners_count":17189754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T21:01:58.797Z","updated_at":"2024-11-08T15:30:17.856Z","avatar_url":"https://github.com/juliangruber.png","language":"JavaScript","funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# npmd\n\ndistributed npm client.\n\n`npmd` is an alternative npm client that uses local replication and smart caching\nimprove performance by eliminating unnecessary network round-trips.\nIt is intended for use in the antipodes, via 3g, in airplanes, submarines, up trees, and in caves.\nBut it is still faster if you live in california too.\n\n## install\n\ninstall carefully.\n\n``` js\nnpm install npmd@1 -g --carefully\n```\n\n## npmd@1\n\nI've recently rewritten the heart of npmd,\nadding [npmd-cache](https://github.com/dominictarr/npmd-cache)\nand changing how [npmd-resolve](https://github.com/dominictarr/npmd-resolve) and\n[npmd-install](https://github.com/dominictarr/npmd-install) retrive modules.\n\nSyncing metadata was one of the best ideas in npmd@0, but also one of the most annoying.\nSyncing is gone for now, but it will return soon as an option. npmd@1 is much more simple,\nand, by using [Alan Gutierrez's](https://twitter.com/bigeasy) pure javascript database\n[Locket](https://github.com/bigeasy/locket), npmd will not require a compiled node addon\nand so will be easy to run even on windows. (this is still in development, so bear with us)\n\n### npmd-cache\n\nnpmd keeps a cache of modules you have installed, but it works different to npm's cache.\n\nnpm keeps a cache of modules at versions, see `~/.npm/{module}/{version}` and of npm docs\nthat npm has downloaded `~/.npm/{module}/.cache.json`. Unfortunately, this does not work well\noffline, because it does not cache modules that where installed via `git` or `http` urls.\n(any module with a largish dependency tree is likely to have at least one of these)\n\nnpmd-cache works differently, it's cache is divided into two parts - the mutable side,\nand the immutable side. The immutable side stores tarballs, and the mutable side stores module ids.\nWhat is a module id? there are several ways to identify a module in npm. The best is\nby it's name and version `{module}@{version}` but you can also install tarballs from\nhttp or git urls (if they return something containing a package.json).\n\nThere is no standard way to tell wether a url refers to an immutable resource.\nThat means that the next time you request that url it may be give a different response.\nEven `{module}@{version}` is _nearly_ immutable, but not completely, because module versions can be deleted.\n\nHowever, code changes relatively slowly, and if you are working offline (freedom from distractions)\nso npmd stores what tarball shasum a module id points to, so you can install that module again later.\nSince the tarballs are identified by their shasum, so you can always grab an exact version.\n\n### npmd-resolve\n\n`npmd` splits out resolving a dependency tree from installing a dependency tree, but in npm these two things\nare tangled together. `npmd-resolve` takes a module id, or `{module}@{versionRange}` and builds a json\nobject that represents all the modules which should be installed, and the shasums they should have.\n\nThe format of this object is compatible with the json generated by the `npm shrinkwrap` command,\nwhich can be used to install exactly the same deps again. \n\n`npmd-resolve` in bundled inside `npmd`, but it can also be used as a standalone tool.\n\n``` js\nnpm install npmd-resolve -g\n\nnpmd-resolve npmd \u003e npmd.deps.json\n```\nthis can then be fed into `npmd-install`\n\n### npmd-install\n\n`npmd-install` takes a dependency tree with shasums and extracts them into a node_modules folder.\nit is bundled inside `npmd` or can be installed as a standalone tool.\n\n``` js\nnpm install npmd-install -g\n\nnpmd-install \u003c npmd.deps.json\n```\n\nnote, since `npmd-install` and `npmd-resolve` may both write to the mutable database inside `npmd-cache`,\nyou cannot run them both at the same time. If you want to feed the output of one into the other, you must do so via a file.\n\n``` js\nnpmd-resolve browserify \u003e b; npmd-install \u003c b; rm b\n```\n\nThis will get fixed at some point, but for now the simplest is just to use `npmd install browserify`\n\n## help\n\ndisplay help files\n\n```\nnpmd help $command\n```\n\n## install\n\ninstall a module. if the module's dependencies are in the cache,\nthen `npmd` will install without making a single network round trip!\n\n```\nnpmd install browserify --greedy\n```\n\n`--greedy` is optional, if enabled, the dependency tree is flattened as much as possible.\nso you have less duplication.\n\nuse `--global` to install a command globally.\n\n## resolve\n\nresolve all module versions required to install a given module.\nwill write json to stdout in the same format as npm-shrinkwrap. \n\n```\nnpmd resolve request\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliangruber%2Fnpmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliangruber%2Fnpmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliangruber%2Fnpmd/lists"}