Skip to content

clojure/tools.deps.edn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tools.deps.edn

Reader for deps.edn

Rationale

This is a small library for reading and manipulating deps.edn files and data structures. It can be used in scenarios where the full tools.deps library is not needed for dep expansion (which pulls in many large libraries).

Release Information

Latest release: 0.9.22

deps.edn dependency information:

org.clojure/tools.deps.edn {:mvn/version "0.9.22"}

Leiningen dependency information:

[org.clojure/tools.deps.edn "0.9.22"]

Maven dependency information:

<dependency>
  <groupId>org.clojure</groupId>
  <artifactId>tools.deps.edn</artifactId>
  <version>0.9.22</version>
</dependency>

API

Reading, validating, and canonicalization

Usually, you should use the read-deps function to read a deps.edn file, validate, and canonicalize it:

  • (read-deps f & opts) - coerce f to a File, then read, validate, canonicalize and return a deps.edn map

However, these component functions may also occasionally be useful:

  • (read-edn r & opts) - reads a single edn value from a Reader r
  • (validate deps-edn & opts) - validate a deps.edn map against the specs and throw or return the valid map
  • (canonicalize deps-edn & opts) - canoncialize a deps.edn map and return it

Deps chain

These functions are available to get individual or multiple of the standard deps.edn maps in the chain:

  • (root-deps) - return the root deps read as a resource
  • (user-deps-path) - calculate the path to the user deps.edn
  • (user-deps) - use user-deps-path, then read and return it (or nil if none exists)
  • (project-deps-path) - calculate the path to the project deps.edn, using the dir context as the current directory
  • (project-deps) - use project-deps-path, then read and return it (or nil if none exists)
  • (create-edn-maps) (create-edn-maps params-map) - takes optional map of location sources and returns a map of the root, user, project, and extra deps.edn maps

Data manipulation

These functions can be used to modify or extract information from a deps.edn map:

  • (merge-edns deps-edn-maps) - merge multiple deps.edn maps in a chain
  • (merge-alias-maps) - like merge-with, for merging alias maps with per-key rules
  • (combine-aliases) - find, read, and combine alias maps identified by alias keywords from a deps edn map into a single args map.

Developer Information

Copyright and License

Copyright © Rich Hickey, Alex Miller, and contributors

All rights reserved. The use and distribution terms for this software are covered by the Eclipse Public License 1.0 which can be found in the file LICENSE at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove this notice, or any other, from this software.

About

Reader for deps.edn files

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •