@transloadit/prettier-bytes

WebJar for @transloadit/prettier-bytes

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

transloadit__prettier-bytes
Last Version

Last Version

0.0.7
Release Date

Release Date

Type

Type

jar
Description

Description

@transloadit/prettier-bytes
WebJar for @transloadit/prettier-bytes
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/transloadit/monolib

Download transloadit__prettier-bytes

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/transloadit__prettier-bytes/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>transloadit__prettier-bytes</artifactId>
    <version>0.0.7</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/transloadit__prettier-bytes/
implementation 'org.webjars.npm:transloadit__prettier-bytes:0.0.7'
// https://jarcasting.com/artifacts/org.webjars.npm/transloadit__prettier-bytes/
implementation ("org.webjars.npm:transloadit__prettier-bytes:0.0.7")
'org.webjars.npm:transloadit__prettier-bytes:jar:0.0.7'
<dependency org="org.webjars.npm" name="transloadit__prettier-bytes" rev="0.0.7">
  <artifact name="transloadit__prettier-bytes" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='transloadit__prettier-bytes', version='0.0.7')
)
libraryDependencies += "org.webjars.npm" % "transloadit__prettier-bytes" % "0.0.7"
[org.webjars.npm/transloadit__prettier-bytes "0.0.7"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

🏡 monolib

A private monorepo with publicly published single-file JavaScript utils that we can re-use in our different projects.

To many small functions that just don't belong, it's the place they call home.

For 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/.

Modules 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.

While 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. Hence, the license is AGPL-3.0-only, and we add unwelcoming READMEs with disclaimers to the modules.

Rules

  • Bundle a Jest test with your function
  • Pure functions only please

Examples

Module Example Result
@transloadit/abbr abbr('Lorem ipsum dolor sit amet', 10, ' .. ')) 'Lor .. met'
@transloadit/analyze-step analyzeStep({ robot: '/image/resize', width: '75', height: '75' }, ROBOTS) 'Resize images to 75×75'
@transloadit/enrich-tweet await enrichTweet(TWEET) The text of the tweet, linked, short URLs expanded
@transloadit/file-exists await fileExists('foo.jpg') true
@transloadit/format-duration-ms formatDurationMs(10000000) '2h46m40s'
@transloadit/post $ post [subdir] Asks questions and creates a markdown post, by default in subdir ./_posts
@transloadit/prettier-bytes prettierBytes(235555520) '225 MB'
@transloadit/slugify slugify('--This is My App !~') 'this-is-my-app'
@transloadit/sort-object sortObject({b: 'a', a: 'b'}) {a: 'b', b: 'a'}
@transloadit/sort-object-by-prio sortObjectByPrio({b: 'a', a: 'b'}, {_: ['b']}) {b: 'a', a: 'b'}
@transloadit/sort-assembly sortAssembly(ASSEMBLY_OBJECT) Sorted Assembly Object
@transloadit/sort-result-meta sortResultMeta(ASSEMBLY_RESULT_META_OBJECT) Sorted Assembly Object
@transloadit/sort-result sortResult(ASSEMBLY_RESULT_OBJECT) Sorted Assembly Object

Check https://github.com/transloadit/monolib/tree/master/packages.

How to consume these functions?

In your project, type:

# yarn
yarn add @transloadit/analyze-step

# npm
npm i @transloadit/analyze-step --save-exact

How to check out this repo locally?

cd code
git clone [email protected]:transloadit/monolib.git
cd monolib
git pull
yarn

How to add functions?

  • Easiest is run make new (this will ask for the new module name, then duplicate ./template-package to a directory in ./packages/<name> and replace any replace-me or replaceMe respectively)
  • Write your function & test
  • Add an example to the table in this README.md
  • Commit
  • Run yarn pub to publish (that's just an alias to lerna publish)

How to run tests?

make test-watch

# yarn
yarn test:watch

# npm
npm run test:watch

How to iterate quickly inside a consuming project without publishing 100 versions?

$ cd ~/code/monolib/packages/analyze-step
$ yarn link
yarn link v1.22.4
success Registered "@transloadit/analyze-step".
info 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.
Done in 0.04s.

$ cd ~/code/content
$ yarn link @transloadit/analyze-step
yarn link v1.22.4
success Using linked package for "@transloadit/analyze-step".
Done in 0.04s.
org.webjars.npm

Transloadit

The world's most advanced file processing service for developers

Versions

Version
0.0.7