posify

Convert your webpage to platformOS one

Usage no npm install needed!

<script type="module">
  import posify from 'https://cdn.skypack.dev/posify';
</script>

README

posify

Convert your webpage to platformOS one

This CLI consists of commands that are performing single operations on a webpage.

Process

This is the order they should be run on:

  1. posify download -u url (after download is complete, go into the directory, cd <domain>)
  2. posify urls
  3. posify forms

Optionally, if not sure that assets are correctly optimized (usually they are not):

  1. posify optimize:css
  2. posify optimize:js
  3. posify optimize:images

Case sensitive paths

All paths are lowercased to guarantee compatibility. Some webpages were using methods incompatible with mac OS.

So path https://example.com/IMAGES/bg.jpg will become a file app/assets/images/bg.jpg

Some pages have both: Images/bg.jpg and images/avatar.jpg on the same page, but because Images and images directories cannot coexist in the same place on mac OS, it caused some assets to be in the wrong place.

Installation

$ npm install -g posify

Help usage

$ posify help [COMMAND]

$ posify (-v|--version|version)

Example:

$ posify help

$ posify help download
$ posify -v
posify/0.1.1 darwin-x64 node-v12.16.1

Commands

posify download --url http://example.com

Download a complete webpage with assets

USAGE
  $ posify download --url http://example.com

OPTIONS
  -c, --concurrency=concurrency  [default: 5] Max concurrent connections
  -u, --url=url                  (required) URL of webpage to download

DESCRIPTION
  Downloads resources needed to display a webpage.
  It will download files only within the same root domain.

  For example, if you download https://my.example.site.example.com,
  only files within example.com will be downloaded.

EXAMPLES
  posify download -c 25 -u http://example.com

See code: src/commands/download.js

posify forms

Installs Simpleform module

USAGE
  $ posify forms

DESCRIPTION
  Install Simpleform module. It sends email to the app owner when form is submitted.
  This command will create modules/ directory in current directory.
  You should run this command in root directory of the project (where you see app/)

See code: src/commands/forms.js

posify help [COMMAND]

display help for posify

USAGE
  $ posify help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

posify optimize:css

Minify CSS files

USAGE
  $ posify optimize:css

DESCRIPTION
  Makes your CSS files smaller and production ready
  Ignores files that end with .min.css

See code: src/commands/optimize/css.js

posify optimize:images

Optimize images to make them smaller - mac OS only

USAGE
  $ posify optimize:images

OPTIONS
  -q, --quality=quality  [default: 70-85] Quality range

DESCRIPTION
  Optimize jpeg/jpg, png, gif, svg and webp files to make them web-ready
  Requires ImageOptim to be installed in the system.

  Install via brew: "brew update && brew cask install imageoptim"
  Install with GUI: https://imageoptim.com/mac

See code: src/commands/optimize/images.js

posify optimize:js

Minify JS code

USAGE
  $ posify optimize:js

DESCRIPTION
  Makes your JS files smaller and production ready
  Ignores files that end with .min.js

See code: src/commands/optimize/js.js

posify urls

Update relative paths to use platformOS CDN

USAGE
  $ posify urls

DESCRIPTION
  Find and replace urls in html files, mostly needed for assets and forms.
  It will also remove any onsubmit attributes from forms.

See code: src/commands/urls.js