Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/axelson/mix_lock_parser
https://github.com/axelson/mix_lock_parser
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/axelson/mix_lock_parser
- Owner: axelson
- Created: 2023-09-09T20:54:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-14T16:43:47.000Z (over 1 year ago)
- Last Synced: 2024-12-16T00:47:26.248Z (about 1 month ago)
- Language: Elixir
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MixLockParser
MixLockParser is able to read an Elixir `mix.lock` file and return the list of
dependencies used and their versions.In the future it may be expanded to also include information about your direct
dependencies dependencies but I don't have a use-case that requires it for now
so that is currently out of scope.```iex
iex> contents = """
...> %{
...> "contex": {:hex, :contex, "0.5.0", "5d8a6defbeb41f54adfcb0f85c4756d4f2b84aa5b0d809d45a5d2e90d91d0392", [:mix], [{:nimble_strftime, "~> 0.1.0", [hex: :nimble_strftime, repo: "hexpm", optional: false]}], "hexpm", "b7497a1790324d84247859df44ba4bcf2489d9bba1812a5375b2f2046b9e6fd7"},
...> "dotenv_parser": {:hex, :dotenv_parser, "2.0.0", "0f999196857e4ee18cbba1413018d5e4980ab16b397e3a2f8d0cf541fe683181", [:mix], [], "hexpm", "e769bde2dbff5b0cd0d9d877a9ccfd2c6dd84772dfb405d5a43cceb4f93616c5"}
...> }
...> """
iex> MixLockParser.read_mix_lock_contents!(contents)
[{:contex, :hex, "0.5.0"}, {:dotenv_parser, :hex, "2.0.0"}]# Or you can read directly from a file
iex> MixLockParser.read_mix_lock!("priv/sample_lockfiles/short_mix.lock")
[{:nimble_parsec, :hex, "1.3.1"}]
```- [x] Write user-facing readme
- [ ] Support path dependencies
- [x] Add tests for older versions of lock files## Installation
This package is not currently on hex but can be installed by adding
`mix_lock_parser` to your list of dependencies in `mix.exs`:```elixir
def deps do
[
{:mix_lock_parser, github: "axelson/mix_lock_parser"},
]
end
```