{"id":20159548,"url":"https://github.com/transloadit/monolib","last_synced_at":"2026-01-07T00:10:12.499Z","repository":{"id":40800710,"uuid":"241102176","full_name":"transloadit/monolib","owner":"transloadit","description":":house_with_garden: A monorepo with publicly published TypeScript utils that we can re-use in our different projects. Not recommended for use outside Transloadit. No SemVer guarantees. Use at own Risk.","archived":false,"fork":false,"pushed_at":"2025-02-27T10:21:59.000Z","size":2013,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-24T01:25:34.989Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/org/transloadit","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/transloadit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2020-02-17T12:28:01.000Z","updated_at":"2025-02-27T10:20:52.000Z","dependencies_parsed_at":"2023-02-18T17:00:40.939Z","dependency_job_id":"f9fbf1b9-0674-4ee1-b7e3-e1837e822cd8","html_url":"https://github.com/transloadit/monolib","commit_stats":{"total_commits":341,"total_committers":12,"mean_commits":"28.416666666666668","dds":"0.32551319648093846","last_synced_commit":"16f4eecb3009b7d5c24d726baeb330b84a5c15d5"},"previous_names":[],"tags_count":348,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transloadit%2Fmonolib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transloadit%2Fmonolib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transloadit%2Fmonolib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transloadit%2Fmonolib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/transloadit","download_url":"https://codeload.github.com/transloadit/monolib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247621349,"owners_count":20968438,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-14T00:08:55.847Z","updated_at":"2026-01-07T00:10:12.458Z","avatar_url":"https://github.com/transloadit.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :house_with_garden: monolib\n\nAn internal monorepo with publicly published single-file TypeScript utils that we can re-use across our different projects.\n\nIt's the home to many small functions that just don't belong.\n\nFor example, Uppy has its own way of reporting bytes. We moved that function here, so now we can easily add it to our node-sdk, API, and content repo where React would be outputting bytes in /c/.\n\nModules are public so they can be re-used without configuring registries and setting tokens for anybody consuming them. This allows the modules to be used in e.g. Uppy or the Node SDK.\n\nWhile the world _can_ consume the modules, this is mostly to make life easier for us, we won't encourage people to use these modules in their own projects. We may break SemVer with no regard to external projects. Hence, the license is AGPL-3.0-only, and we add unwelcoming READMEs with disclaimers to the modules.\n\n## Rules\n\n- Bundle a test with your function\n- Pure functions only please\n\n## Examples\n\n| Module                             | Example                                                                      | Result                                                                      |\n| :--------------------------------- | :--------------------------------------------------------------------------- | :-------------------------------------------------------------------------- |\n| `@transloadit/abbr`                | `abbr('Lorem ipsum dolor sit amet', 10, ' .. '))`                            | `'Lor .. met'`                                                              |\n| `@transloadit/analyze-step`        | `analyzeStep({ robot: '/image/resize', width: '75', height: '75' }, ROBOTS)` | `'Resize images to 75×75'`                                                  |\n| `@transloadit/file-exists`         | `await fileExists('foo.jpg')`                                                | `true`                                                                      |\n| `@transloadit/format-duration-ms`  | `formatDurationMs(10000000)`                                                 | `'2h46m40s'`                                                                |\n| `@transloadit/post`                | `$ post [subdir]`                                                            | Asks questions and creates a markdown post, by default in subdir `./_posts` |\n| `@transloadit/pr`                  | `pr({ a: 1 })`                                                               | Dumps `{a: 1}` on the console, used for debugging                           |\n| `@transloadit/prd`                 | `prd({ a: 1 })`                                                              | Dumps `{a: 1}` on the console and exits program, used for debugging         |\n| `@transloadit/prettier-bytes`      | `prettierBytes(235555520)`                                                   | `'225 MB'`                                                                  |\n| `@transloadit/slugify`             | `slugify('--This is My App !~')`                                             | `'this-is-my-app'`                                                          |\n| `@transloadit/sort-object`         | `sortObject({b: 'a', a: 'b'})`                                               | `{a: 'b', b: 'a'}`                                                          |\n| `@transloadit/sort-object-by-prio` | `sortObjectByPrio({b: 'a', a: 'b'}, {_: ['b']})`                             | `{b: 'a', a: 'b'}`                                                          |\n| `@transloadit/sort-assembly`       | `sortAssembly(ASSEMBLY_OBJECT)`                                              | Sorted Assembly Object                                                      |\n| `@transloadit/sort-result-meta`    | `sortResultMeta(ASSEMBLY_RESULT_META_OBJECT)`                                | Sorted Assembly Object                                                      |\n| `@transloadit/sort-result`         | `sortResult(ASSEMBLY_RESULT_OBJECT)`                                         | Sorted Assembly Object                                                      |\n\nCheck \u003chttps://github.com/transloadit/monolib/tree/main/packages\u003e.\n\n## How to consume these functions?\n\nIn your project, type:\n\n```bash\n# yarn\nyarn add @transloadit/analyze-step\n\n# npm\nnpm i @transloadit/analyze-step --save-exact\n```\n\n## How to check out this repo locally?\n\n```bash\ncd code\ngit clone git@github.com:transloadit/monolib.git\ncd monolib\ngit pull\nyarn\n```\n\n## How to add functions?\n\n- Easiest is to duplicate `./template-package` to a directory in `./packages/\u003cname\u003e` and replace any `replace-me` or `replaceMe` respectively)\n- Add it to the `tsconfig.json` file\n- Traverse into `./packages/\u003cname\u003e/` and `yarn add` whichever dependency you need like you would normally\n- Write your function \u0026 test (`yarn test:watch`)\n- Add an example to the table in this `README.md`\n- Create a changeset to document your changes (`yarn changeset`)\n- Commit and push your changes\n\n## How to run tests?\n\n```bash\n# yarn\nyarn test:watch\n```\n\n## How do I publish these packages?\n\nFirst make your changes and push them to the repository. We use Changesets to manage versions and changelogs.\n\n1. Create a changeset for your changes:\n\n```bash\nyarn changeset\n```\n\n2. Push your changes and changeset files to the repository.\n\n3. When ready to release:\n   - A GitHub Action will automatically create a PR with all version updates\n   - Once merged to main, it will automatically publish to npm\n\nTo publish manually:\n\n1. Make sure you have push rights for the `main` branch of this repository\n2. Log in to the NPM registry:\n\n```bash\nnpm login\n```\n\n3. Create versions and changelogs:\n\n```bash\nyarn version\n```\n\n4. Build and publish:\n\n```bash\nyarn release\n```\n\n## How to iterate quickly inside a consuming project without publishing 100 versions?\n\n```bash\n$ cd ~/code/monolib/packages/analyze-step\n$ yarn link\nyarn link v1.22.4\nsuccess Registered \"@transloadit/analyze-step\".\ninfo You can now run `yarn link \"@transloadit/analyze-step\"` in the projects where you want to use this package and it will be used instead.\nDone in 0.04s.\n\n$ cd ~/code/content\n$ yarn link @transloadit/analyze-step\nyarn link v1.22.4\nsuccess Using linked package for \"@transloadit/analyze-step\".\nDone in 0.04s.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransloadit%2Fmonolib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftransloadit%2Fmonolib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransloadit%2Fmonolib/lists"}