npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cloudcannon/asset-uploader

v0.2.1

Published

asset-uploader ==============

Downloads

20

Readme

asset-uploader

oclif Version Downloads/week License

Usage

$ npm install -g @cloudcannon/asset-uploader
$ asset-uploader COMMAND
running command...
$ asset-uploader (-v|--version|version)
@cloudcannon/asset-uploader/0.2.1 darwin-x64 node-v10.19.0
$ asset-uploader --help [COMMAND]
USAGE
  $ asset-uploader COMMAND
...

This package is designed to read all .html and .md files from a source repository (-s) and parse the front-matter object looking for image keys (keys that contain _path, image or thumbnail) that have a value pointing to a local file. Each image will be uploaded into the configured folder (-f) to S3 or Cloudinary based on the uploader selected (-u). For every sucessfull image uploaded the process will rewrite the path on the source .html or .md files. Images uploaded to S3 can use a prefix (-p) appended to URL to be updated on the source files.

No changes are commit to the repo. This package only modifies the local files from the source directory.

API Keys

In order to use this package you need to provide valid API Keys.

Before you run the commands, please export the keys to environment variables using the following commands:

S3

$ export AWS_KEY='ABCDEFGHIJKLMNOPQRST'
$ export AWS_SECRET='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
$ export BUCKET='my-bucket-name'

Cloudinary

You can generate and managed the keys from the Cloudinary security settings page

$ export CLOUD_NAME='my-cloud-name'
$ export API_KEY='123456789012345'
$ export API_SECRET='abcdefghijklmnopqrstuvwxyza'

Commands

asset-uploader analyse

Provide an output with the list of assets found to be uploaded. Does not upload any files.

USAGE
  $ asset-uploader analyse

OPTIONS
  -o, --output=output  filename for output changes summary
  -s, --source=source  source of the website to be parsed

See code: src/commands/analyse.js

asset-uploader complete

Scan source directory, upload assets and rewrite source files with the new asset location.

USAGE
  $ asset-uploader complete

OPTIONS
  -f, --folder=folder      folder where to upload the files
  -o, --output=output      filename for output changes summary
  -p, --prefix=prefix      prefix for the URL of the uploaded asset - only applicable to S3 uploader
  -s, --source=source      source of the website to be parsed
  -u, --uploader=uploader  uploader to be used. Choose between: "S3"|"cloudinary"

See code: src/commands/complete.js

asset-uploader help [COMMAND]

display help for asset-uploader

USAGE
  $ asset-uploader help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

asset-uploader upload

Scan source directory and upload assets to selected provider. Does not update the original source files.

USAGE
  $ asset-uploader upload

OPTIONS
  -f, --folder=folder      folder where to upload the files
  -o, --output=output      filename for output changes summary
  -p, --prefix=prefix      prefix for the URL of the uploaded asset - only applicable to S3 uploader
  -s, --source=source      source of the website to be parsed
  -u, --uploader=uploader  uploader to be used. Choose between: "S3"|"cloudinary"

See code: src/commands/upload.js