How To Share A Javascript Function?

I have a short javascript function that someone on the Slack channel took an interest in.

What is the best way to share it? Right now I’m inclined to clean up a sample action that contains it in a single javascript step and then share the action.

Is that really the best way? I wonder as for recipients a degree of unpacking is required - though I can see good comments in the javascript might make that worthwhile.

For a single function, I would say anyone who might make use of JavaScript in Drafts would have enough understanding to paste it into a script step from just sharing it as a code block. I would imagine that would be quicker than downloading and installing the action, opening the step, copying out the details from there and then navigating it to and pasting it into where they want to use it.

And where would I post that? Is here a good bet? Or the Slack channel (unlikely)?

I’d personally consider posting it here and linking to it in the Slack channel.

1 Like

OK. It’s here.