Browse Source

Updated the documentation

master
Cédric Belin 2 weeks ago
parent
commit
2d6c5b225e
4 changed files with 18 additions and 18 deletions
  1. +1
    -1
      README.md
  2. +2
    -2
      doc/index.md
  3. +5
    -5
      doc/installation.md
  4. +10
    -10
      doc/usage.md

+ 1
- 1
README.md View File

@@ -1,5 +1,5 @@
# Gulp-David
![Gulp](https://badgen.net/badge/gulp/%3E%3D4.0.0/green) ![Runtime](https://badgen.net/npm/node/@cedx/gulp-david) ![Release](https://badgen.net/npm/v/@cedx/gulp-david) ![Types](https://badgen.net/npm/types/@cedx/gulp-david) ![License](https://badgen.net/npm/license/@cedx/gulp-david) ![Downloads](https://badgen.net/npm/dt/@cedx/gulp-david) ![Dependencies](https://badgen.net/david/dep/cedx/gulp-david) ![Coverage](https://badgen.net/coveralls/c/github/cedx/gulp-david) ![Build](https://badgen.net/github/checks/cedx/gulp-david)
![Gulp](https://badgen.net/badge/gulp/%3E%3D4.0.0/green) ![Runtime](https://badgen.net/npm/node/@cedx/gulp-david) ![Release](https://badgen.net/npm/v/@cedx/gulp-david) ![Types](https://badgen.net/npm/types/@cedx/gulp-david) ![License](https://badgen.net/npm/license/@cedx/gulp-david) ![Downloads](https://badgen.net/npm/dt/@cedx/gulp-david) ![Dependencies](https://badgen.net/david/dep/cedx/gulp-david) ![Coverage](https://badgen.net/coveralls/c/github/cedx/gulp-david) ![Build](https://badgen.net/github/checks/cedx/gulp-david/main)

Check your [npm](https://www.npmjs.com) dependencies with the [David](https://badgen.net/david/dep) plug-in for [Gulp](https://gulpjs.com), the streaming build system.



+ 2
- 2
doc/index.md View File

@@ -1,12 +1,12 @@
# Gulp-David
![Gulp](https://badgen.net/badge/gulp/%3E%3D4.0.0/green) ![Runtime](https://badgen.net/npm/node/@cedx/gulp-david) ![Release](https://badgen.net/npm/v/@cedx/gulp-david) ![Types](https://badgen.net/npm/types/@cedx/gulp-david) ![License](https://badgen.net/npm/license/@cedx/gulp-david) ![Downloads](https://badgen.net/npm/dt/@cedx/gulp-david) ![Dependencies](https://badgen.net/david/dep/cedx/gulp-david) ![Coverage](https://badgen.net/coveralls/c/github/cedx/gulp-david) ![Build](https://badgen.net/github/checks/cedx/gulp-david)
![Gulp](https://badgen.net/badge/gulp/%3E%3D4.0.0/green) ![Runtime](https://badgen.net/npm/node/@cedx/gulp-david) ![Release](https://badgen.net/npm/v/@cedx/gulp-david) ![Types](https://badgen.net/npm/types/@cedx/gulp-david) ![License](https://badgen.net/npm/license/@cedx/gulp-david) ![Downloads](https://badgen.net/npm/dt/@cedx/gulp-david) ![Dependencies](https://badgen.net/david/dep/cedx/gulp-david) ![Coverage](https://badgen.net/coveralls/c/github/cedx/gulp-david) ![Build](https://badgen.net/github/checks/cedx/gulp-david/main)

Check your [npm](https://www.npmjs.com) dependencies with the [David](https://badgen.net/david/dep) plug-in for [Gulp](https://gulpjs.com), the streaming build system.

## Quick start
Install the latest version of **Gulp-David** with [npm](https://www.npmjs.com):

```shell
``` shell
npm install @cedx/gulp-david
```



+ 5
- 5
doc/installation.md View File

@@ -6,12 +6,12 @@ You also need the [Command Line Utility for Gulp](https://www.npmjs.com/package/
You can verify if you're already good to go with the following commands:

```shell
``` shell
node --version
# v14.5.0
# v15.1.0

npm --version
# 6.14.5
# 7.0.8

gulp --version
# CLI version: 2.2.0
@@ -27,13 +27,13 @@ gulp --version
### 1. Install it
From a command prompt, run:

```shell
``` shell
npm install @cedx/gulp-david
```

### 2. Import it
Now in your [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) code, you can use:

```js
``` js
import {david} from '@cedx/gulp-david';
```

+ 10
- 10
doc/usage.md View File

@@ -18,7 +18,7 @@ You have two possibles choices:

If you choose the second option, as long as Gulp does not natively support ES modules, you must load this package using an [`import` expression](https://nodejs.org/api/esm.html#esm_import_expressions):

```js
``` js
const {series, src, task} = require('gulp');

let david;
@@ -30,7 +30,7 @@ task('checkDependencies', series('david:import', 'david:run'));
## Programming interface
The plug-in takes a [`package.json`](https://docs.npmjs.com/files/package.json) file as input, and scans its dependencies to check whether any one is outdated:

```js
``` js
import {david} from '@cedx/gulp-david';
import gulp from 'gulp';

@@ -60,7 +60,7 @@ The plug-in can be customized using these settings:
### Results
The plug-in adds the following properties to the `file` object:

```js
``` js
file.david = {
dependencies: {}, // Details about the required dependencies needing an update.
devDependencies: {}, // Details about the development dependencies needing an update.
@@ -72,7 +72,7 @@ file.david = {
By default, the plug-in prints to the standard output the list of outdated packages.
You can disable this output by setting the `reporter` option to `false`.

```js
``` js
import {david} from '@cedx/gulp-david';
import gulp from 'gulp';

@@ -82,9 +82,9 @@ gulp.task('checkDependencies', () =>
```

You can also replace this reporter by your own implementation.
Look at the source of the [built-in reporter](https://git.belin.io/cedx/gulp-david/src/branch/master/src/reporter.ts) for a code sample.
Look at the source of the [built-in reporter](https://git.belin.io/cedx/gulp-david/src/branch/main/src/reporter.ts) for a code sample.

```js
``` js
import {david} from '@cedx/gulp-david';
import gulp from 'gulp';

@@ -96,7 +96,7 @@ gulp.task('checkDependencies', () =>
## Updating dependencies
The plug-in lets you update dependencies in the manifest file to latest versions and save them back to the file system:

```js
``` js
import {david} from '@cedx/gulp-david';
import gulp from 'gulp';

@@ -109,14 +109,14 @@ gulp.task('updateDependencies', () => gulp.src('package.json')
By default, the plug-in will use the caret operator (e.g. `^`) to specifiy the version comparators in the manifest file.
You can use a different operator by providing a string indicating the wanted one:

```js
``` js
gulp.src('package.json').pipe(david({update: '~'}));
gulp.src('package.json').pipe(david({update: '>='}));
```

In order to pin your dependencies, just use the equality operator:

```js
``` js
import {david} from '@cedx/gulp-david';
import gulp from 'gulp';

@@ -127,4 +127,4 @@ gulp.task('updateDependencies', () =>

## Examples
You can find a more detailled sample in the `example` folder:
[Sample Gulp tasks](https://git.belin.io/cedx/gulp-david/src/branch/master/example/gulpfile.js)
[Sample Gulp tasks](https://git.belin.io/cedx/gulp-david/src/branch/main/example/gulpfile.js)

Loading…
Cancel
Save