How to do equivalent of npm install --save with dub?

Rikki Cattermole via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jan 12 17:05:36 PST 2015


On 13/01/2015 2:01 p.m., Andrew Grace wrote:
> I am trying to play with D, but I'm getting stuck with the DUB package
> manager.  If use DUB to download a package to my project, how do I get
> DUB to add what I downloaded to the dub.json file? I have tried DUB
> --fetch --cache=local http-parser (for example).  It downloads the
> package, but then nothing is added to the list of dependencies.
>
> I'd appreciate any help.
>
> Thanks,
> Andrew

Documentation here: http://code.dlang.org/package-format

Basically:
{
	"name": "myproject",
	...
	"dependencies": {
		"project(:subproject)?": "semver"
	}
}

There's no need to tell dub to download any package. It'll do so 
automatically.


More information about the Digitalmars-d-learn mailing list