Package 'minifier'

Title: Minify JS, CSS and HTML Files
Description: Using the 'Toptal' API to minify JavaScript, CSS and HTML files.
Authors: Ashley Baldry [cre, aut], Toptal [aut] (Owner of the Minifier API)
Maintainer: Ashley Baldry <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2024-11-17 03:09:10 UTC
Source: https://github.com/ashbaldry/minifier

Help Index


Minify Code

Description

This...

Usage

minify(code, language = MINIFY_LANGUAGES)

Arguments

code

Snippet of code to minify

language

Language of the code to minify. Options are javascript, css, html

See Also

https://www.toptal.com/developers/javascript-minifier/api https://www.toptal.com/developers/cssminifier/api https://www.toptal.com/developers/html-minifier/api


Minify File

Description

Using the

Usage

minifyJSDirectory(
  directory,
  single_file = TRUE,
  minified_dir_name = directory,
  minified_file_name = paste0(basename(directory), ".min.js")
)

minifyCSSDirectory(
  directory,
  single_file = TRUE,
  minified_dir_name = directory,
  minified_file_name = paste0(basename(directory), ".min.css")
)

minifyHTMLDirectory(
  directory,
  single_file = TRUE,
  minified_dir_name = directory,
  minified_file_name = paste0(basename(directory), ".min.html")
)

Arguments

directory

Path to the files to be minified

single_file

Should all the files be minified to a single file? Default set to TRUE

minified_dir_name, minified_file_name

If single_file = TRUE, the directory and name of the minified file

See Also

minify


Minify File

Description

Using the

Usage

minifyJSFile(file_name)

minifyCSSFile(file_name)

minifyHTMLFile(file_name)

Arguments

file_name

Path to the file to be minified