Skip to content

Commit

Permalink
docs(readme): update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
srod committed Feb 15, 2023
1 parent 22a7b88 commit d5fad4c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 44 deletions.
36 changes: 15 additions & 21 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,29 @@ It allow you to compress JavaScript, CSS and HTML files.
## Installation

```bash
npm install @node-minify/core # OR yarn add @node-minify/core OR pnpm add @node-minify/core
npm install @node-minify/core
# Or Yarn
yarn add @node-minify/core
# Or pnpm
pnpm add @node-minify/core
```

And install the compressor you want

```bash
npm install @node-minify/uglify-js # OR yarn add @node-minify/uglify-js OR pnpm add @node-minify/uglify-js
npm install @node-minify/uglify-js
# Or Yarn
yarn add @node-minify/uglify-js
# Or pnpm
pnpm add @node-minify/uglify-js
```

## Quick Start

```js
const minify = require('@node-minify/core');
const gcc = require('@node-minify/google-closure-compiler');
const uglifyjs = require('@node-minify/uglify-js');
import minify from '@node-minify/core';
import gcc from '@node-minify/google-closure-compiler';
import uglifyjs from '@node-minify/uglify-js';

// Using Google Closure Compiler
minify({
Expand Down Expand Up @@ -90,24 +98,10 @@ async function doMinify() {
}
```

### ES2015+

```js
import minify from '@node-minify/core';
import gcc from '@node-minify/google-closure-compiler';

minify({
compressor: gcc,
input: 'foo.js',
output: 'bar.js',
callback: function (err, min) {}
});
```

### In memory

```js
const htmlMinifier = require('@node-minify/html-minifier');
import htmlMinifier from '@node-minify/html-minifier';

const html = `
<!doctype html>
Expand All @@ -126,7 +120,7 @@ minify({
});
```

[More examples](https://github.com/srod/node-minify/blob/master/examples/server.js)
[More examples](https://github.com/srod/node-minify/blob/master/examples/server.mjs)

## Documentation

Expand Down
40 changes: 17 additions & 23 deletions docs/src/content/docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
---
title: "Getting Started"
description: "Getting Started for node-minify"
title: 'Getting Started'
description: 'Getting Started for node-minify'
---

## Installation

```bash
npm install @node-minify/core # OR yarn add @node-minify/core OR pnpm add @node-minify/core
npm install @node-minify/core
yarn add @node-minify/core
pnpm add @node-minify/core
```

And install the compressor you want

```bash
npm install @node-minify/uglify-js # OR yarn add @node-minify/uglify-js OR pnpm add @node-minify/uglify-js
npm install @node-minify/core
# Or Yarn
yarn add @node-minify/core
# Or pnpm
pnpm add @node-minify/core
```

## Quick Start

```js
const minify = require('@node-minify/core');
const gcc = require('@node-minify/google-closure-compiler');
const uglifyjs = require('@node-minify/uglify-js');
npm install @node-minify/uglify-js
# Or Yarn
yarn add @node-minify/uglify-js
# Or pnpm
pnpm add @node-minify/uglify-js

// Using Google Closure Compiler
minify({
Expand Down Expand Up @@ -53,24 +61,10 @@ async function doMinify() {
}
```

### ES2015+

```js
import minify from '@node-minify/core';
import gcc from '@node-minify/google-closure-compiler';

minify({
compressor: gcc,
input: 'foo.js',
output: 'bar.js',
callback: function (err, min) {}
});
```

### In memory

```js
const htmlMinifier = require('@node-minify/html-minifier');
import htmlMinifier from '@node-minify/html-minifier';

const html = `
<!doctype html>
Expand All @@ -89,4 +83,4 @@ minify({
});
```

[More examples](https://github.com/srod/node-minify/blob/master/examples/server.js)
[More examples](https://github.com/srod/node-minify/blob/master/examples/server.js)

0 comments on commit d5fad4c

Please sign in to comment.