{"id":20880809,"url":"https://github.com/curtisalexander/derse","last_synced_at":"2026-05-21T04:36:59.915Z","repository":{"id":80175100,"uuid":"206606081","full_name":"curtisalexander/derse","owner":"curtisalexander","description":"(d)irectory + t(erse) = derse","archived":false,"fork":false,"pushed_at":"2019-09-11T09:14:37.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-31T21:16:12.432Z","etag":null,"topics":["command-line-tool","fsharp"],"latest_commit_sha":null,"homepage":"","language":"F#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/curtisalexander.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-09-05T16:10:41.000Z","updated_at":"2019-09-11T09:14:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"2c4a5c6b-c6d5-4869-88c3-30bf65b9f180","html_url":"https://github.com/curtisalexander/derse","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/curtisalexander/derse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curtisalexander%2Fderse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curtisalexander%2Fderse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curtisalexander%2Fderse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curtisalexander%2Fderse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/curtisalexander","download_url":"https://codeload.github.com/curtisalexander/derse/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curtisalexander%2Fderse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33288911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T02:57:32.698Z","status":"ssl_error","status_checked_at":"2026-05-21T02:57:31.990Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["command-line-tool","fsharp"],"created_at":"2024-11-18T07:22:13.013Z","updated_at":"2026-05-21T04:36:59.902Z","avatar_url":"https://github.com/curtisalexander.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# derse\n\nA terse summary of a directory (non-recursive).\n\n## Background\n\nThis is a simple application experimenting with [.NET Core 3](https://dotnet.microsoft.com/download/dotnet-core/3.0), [F#](https://fsharp.org/), and [Argu](https://fsprojects.github.io/Argu/). In fact, the idea for the functionality is based on a suggested exercise working with [collections](https://livebook.manning.com/book/get-programming-with-f-sharp/chapter-16/) from [Get Programming with F#](https://www.manning.com/books/get-programming-with-f-sharp).\n\n## Usage\n\nFrom Argu.\n\n```\nUSAGE: derse [--help] --directory \u003cdirectory\u003e\n\nOPTIONS:\n\n    --directory \u003cdirectory\u003e\n                          Directory to create summary\n    --help                display this list of options.\n```\n\n## Results\n\nPrints the following information to the console.\n\n- Directory\n- Total File Size (not necessarily size on disk)\n- Average File Size\n- File Count\n- File Extensions\n\n## Limitations\n\nThe summary is not recursive at the moment. It is only prints one directory deep.\n\nIn addition, error checking to see if the `--directory` passed in exists and is truly a directory needs to be added. It is assumed that at least 1 directory and at least 1 file within a directory exists. May need to use other functions from the `Seq` module such as `Seq.choose` in order to work with [Option](https://msdn.microsoft.com/visualfsharpdocs/conceptual/core.option-module-%5bfsharp%5d) types.\n\n# Colophon\n\n## Requirements\n\nDownload and install [.NET Core 3](https://dotnet.microsoft.com/download/dotnet-core/3.0). For this example, I am utilizing the following versions of software. Note that `Argu` is added within [Project Creation and Dependencies](#project-creation-and-dependencies).\n\n```sh\nmacOS version:\n10.14.6\n\ndotnet core version:\n3.0.100-preview9-014004\n\nArgu version:\nProject 'derse' has the following package references\n   [netcoreapp3.0]:\n   Top-level Package      Requested   Resolved\n   \u003e Argu                 5.5.0       5.5.0\n   \u003e FSharp.Core          4.7.0       4.7.0\n```\n\nThis is produced from `versions.sh`.\n\n## Project Creation and Dependencies\n\nCreate a console application.\n\n```\ndotnet new console -lang F#\n```\n\nAdd Argu as a dependency.\n\n```\ndotnet add package Argu --version=5.5.0\n```\n\n## Code\n\nWrite the code.\n\n## Build and Run\n\nBuild and then run to test.\n\n```\ndotnet build\n```\n\nThen to test.\n\n```\ndotnet run -- --directory \"/some/random/dir\"\n```\n\n## Turn into single exe\n\nNow because of [.NET Core 3], we can publish as a [single exe](https://devblogs.microsoft.com/dotnet/announcing-net-core-3-0-preview-5/).\n\n```\ndotnet publish -r osx-x64 -c Release /p:PublishSingleFile=true\n```\n\nTo test.\n\n```\nbin/Release/netcoreapp3.0/osx-x64/publish/derse --help\n```\n\nHow large is the file?\n\n```\ndu -sh bin/Release/netcoreapp3.0/osx-x64/publish/derse\n```\n\nIt is coming in at `80M`. Yikes!\n\n## Tree shaking\n\nReduce the size of the exe. Edit the `derse.fsproj` file. Add the tags `\u003cPublishTrimmed\u003e`, `\u003cPublishReadyToRun\u003e`, `\u003cPublishSingleFile\u003e`, and `\u003cRuntimeIdentifier\u003e`.\n\n```xml\n\u003cProject Sdk=\"Microsoft.NET.Sdk\"\u003e\n  \u003cPropertyGroup\u003e\n    \u003cOutputType\u003eExe\u003c/OutputType\u003e\n    \u003cTargetFramework\u003enetcoreapp3.0\u003c/TargetFramework\u003e\n    \u003cPublishTrimmed\u003etrue\u003c/PublishTrimmed\u003e\n    \u003cPublishReadyToRun\u003etrue\u003c/PublishReadyToRun\u003e\n    \u003cPublishSingleFile\u003etrue\u003c/PublishSingleFile\u003e\n    \u003cRuntimeIdentifier\u003eosx-x64\u003c/RuntimeIdentifier\u003e\n  \u003c/PropertyGroup\u003e\n  \u003cItemGroup\u003e\n    \u003cCompile Include=\"Arguments.fs\" /\u003e\n    \u003cCompile Include=\"Dir.fs\" /\u003e\n    \u003cCompile Include=\"Program.fs\" /\u003e\n  \u003c/ItemGroup\u003e\n  \u003cItemGroup\u003e\n    \u003cPackageReference Include=\"Argu\" Version=\"5.5.0\" /\u003e\n  \u003c/ItemGroup\u003e\n\u003c/Project\u003e\n```\n\nTest again.\n\n```\nbin/Release/netcoreapp3.0/osx-x64/publish/derse --help\n```\n\nCheck the size again.\n\n```\ndu -sh bin/Release/netcoreapp3.0/osx-x64/publish/derse\n```\n\nBetter - at `61MB`.\n\n# Future\n\n## Warp\n\nCan [Warp](https://github.com/dgiagio/warp) [reduce the size](https://www.hanselman.com/blog/BrainstormingCreatingASmallSingleSelfcontainedExecutableOutOfANETCoreApplication.aspx) of the exe?\n\nFirst, add a [.NET Core global tool](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools).\n\n```\ndotnet tool install -g dotnet-warp\n```\n\n**Under construction.**\n:construction:\n\n## Paket\n\nFigure out use of [paket](https://fsprojects.github.io/Paket/) while still utilizing `.NET Core SDK`.\n\n## Azure DevOps\n\nPush with a [git tag]() and then have DevOps build and cut a release on Github. Add instructions using `curl` to install to the README.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurtisalexander%2Fderse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcurtisalexander%2Fderse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurtisalexander%2Fderse/lists"}