EDIT: For Julia version 1. 0+
Pkg.installed seems to have "regressed" with the new package system. For Pkg.installed arguments, Pkg.installed . So the original OP method seems to be the best you can do at the moment.
pkgs = Pkg.installed(); pkgs["Datetime"]
EDIT: For Julia version prior to 0.6.4
You can pass the string to Pkg.installed . For example:
pkgs = Pkg.installed("JuMP")
I often check available call arguments with methods . For example:
julia> methods(Pkg.installed) # 2 methods for generic function "installed": installed() at pkg/pkg.jl:122 installed(pkg::AbstractString) at pkg/pkg.jl:129
or
julia> Pkg.installed |> methods # 2 methods for generic function "installed": installed() at pkg/pkg.jl:122 installed(pkg::AbstractString) at pkg/pkg.jl:129
rickhg12hs
source share