# hornet-js-core

> Ensemble des composants qui forment le coeur de hornet-js

Latest version **5.5.0** (published 2022-03-25) · CECILL-2.1 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install hornet-js-core
pnpm add hornet-js-core
yarn add hornet-js-core
bun add hornet-js-core
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 5.5.0 |
| Published | 2022-03-25 |
| First published | 2015-11-25 |
| Weekly downloads | 0 |
| License | CECILL-2.1 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 54 |
| Unpacked size | 2.1 MB |
| Known vulnerabilities | 0 (+38 in 7 direct dependencies) |
| Install scripts | no |
| Author | MEAE - Ministère de l'Europe et des Affaires étrangères |
| Maintainers | diplomatieviaudn, heurtemattes |

## Links

- npm: https://www.npmjs.com/package/hornet-js-core
- Repository: https://github.com/diplomatiegouvfr/hornet-js-core
- Issues: https://github.com/diplomatiegouvfr/hornet-js-core/issues
- npm.io page: https://npm.io/package/hornet-js-core

## Dependencies (54)

- [ajv](https://npm.io/package/ajv.md) ^6.12.6
- [crc](https://npm.io/package/crc.md) ^3.8.0
- [hpp](https://npm.io/package/hpp.md) ^0.2.3
- [intl](https://npm.io/package/intl.md) ^1.2.5
- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [csurf](https://npm.io/package/csurf.md) ^1.11.0
- [tslib](https://npm.io/package/tslib.md) ^2.3.1
- [cookie](https://npm.io/package/cookie.md) ^0.4.1
- [helmet](https://npm.io/package/helmet.md) ^3.23.3
- [log4js](https://npm.io/package/log4js.md) ^6.3.0
- [multer](https://npm.io/package/multer.md) ^1.4.3
- [carbone](https://npm.io/package/carbone.md) ^1.2.1
- [express](https://npm.io/package/express.md) ^4.17.1
- [pdfmake](https://npm.io/package/pdfmake.md) ^0.1.72
- [director](https://npm.io/package/director.md) ^1.2.8
- [json2csv](https://npm.io/package/json2csv.md) ^5.0.6
- [parseurl](https://npm.io/package/parseurl.md) ^1.3.3
- [uid-safe](https://npm.io/package/uid-safe.md) ^2.1.5
- [csv-parse](https://npm.io/package/csv-parse.md) ^4.16.3
- [onionskin](https://npm.io/package/onionskin.md) ^1.1.6
- [lodash.map](https://npm.io/package/lodash.map.md) ^4.6.0
- [lodash.set](https://npm.io/package/lodash.set.md) ^4.3.2
- [nodemailer](https://npm.io/package/nodemailer.md) ^6.6.5
- [on-headers](https://npm.io/package/on-headers.md) ^1.0.2
- [superagent](https://npm.io/package/superagent.md) ^5.3.1
- [body-parser](https://npm.io/package/body-parser.md) ^1.19.0
- [lodash.fill](https://npm.io/package/lodash.fill.md) ^3.4.0
- [lodash.find](https://npm.io/package/lodash.find.md) ^4.6.0
- [lodash.some](https://npm.io/package/lodash.some.md) ^4.6.0
- [ajv-keywords](https://npm.io/package/ajv-keywords.md) ^3.5.2
- [lodash.merge](https://npm.io/package/lodash.merge.md) ^4.6.2
- [lodash.round](https://npm.io/package/lodash.round.md) ^4.0.4
- [express-state](https://npm.io/package/express-state.md) ^2.0.0
- [lodash.assign](https://npm.io/package/lodash.assign.md) ^4.2.0
- [lodash.filter](https://npm.io/package/lodash.filter.md) ^4.6.0
- [lodash.forown](https://npm.io/package/lodash.forown.md) ^4.4.0
- [lodash.remove](https://npm.io/package/lodash.remove.md) ^4.7.0
- [detect-browser](https://npm.io/package/detect-browser.md) ^4.8.0
- [lodash.foreach](https://npm.io/package/lodash.foreach.md) ^4.5.0
- [lodash.orderby](https://npm.io/package/lodash.orderby.md) ^4.6.0
- [path-to-regexp](https://npm.io/package/path-to-regexp.md) ^6.2.0
- [lodash.assignin](https://npm.io/package/lodash.assignin.md) ^4.2.0
- [lodash.endswith](https://npm.io/package/lodash.endswith.md) ^4.2.1
- [lodash.isnumber](https://npm.io/package/lodash.isnumber.md) ^3.0.3
- [lodash.isstring](https://npm.io/package/lodash.isstring.md) ^4.0.1
- [lodash.uniqueid](https://npm.io/package/lodash.uniqueid.md) ^4.0.1
- [cookie-signature](https://npm.io/package/cookie-signature.md) ^1.1.0
- [lodash.clonedeep](https://npm.io/package/lodash.clonedeep.md) ^4.5.0
- [lodash.findindex](https://npm.io/package/lodash.findindex.md) ^4.6.0
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.13
- [lodash.isfunction](https://npm.io/package/lodash.isfunction.md) ^3.0.9
- [event-loop-monitor](https://npm.io/package/event-loop-monitor.md) ^0.2.0
- [intl-messageformat](https://npm.io/package/intl-messageformat.md) ^2.2.0
- [lodash.isundefined](https://npm.io/package/lodash.isundefined.md) ^3.0.1

## Recent versions

- 5.5.0 (latest) — 2022-03-25
- 5.5.0-rc.4 — 2020-04-06
- 5.4.1 — 2019-07-25
- 5.4.0 — 2019-07-25
- 5.4.0-RC1 — 2019-05-27
- 5.3.0 — 2019-03-28
- 5.2.4 — 2019-01-10
- 5.2.3 — 2018-11-23
- 5.2.2 — 2018-10-17
- 5.2.1 — 2018-10-12
- 5.2.0 — 2018-08-10
- 5.1.1 — 2018-03-22
- 5.0.1 — 2016-02-23
- 5.0.0 — 2015-11-25

## README

# hornet-js-core


Le framework `Hornet` est conçu selon le principe d'`isomorphisme`, c'est à dire que le code d'une application Hornet s'exécute aussi bien dans un navigateur web que sur un serveur d'application Node.js.

Les composants techniques du framework :

* `Node.js` : plateforme logiciel d'exécution du code JavaScript côté serveur
* `Express` : bibliothèque de base pour l'écriture d'application web sur Node.js
* `Director` : composant de gestion du routage des urls sur le serveur
* `React` : bibliothèque de création d'IHM html selon une logique orientée composants
* `Superagent` : composant JavaScript pour l'exécution d'appels http
* `Webpack` : outil de création de paquetages (JavaScript, CSS, ...) pour les navigateurs web
* `Gulp` : outil pour la création de tâches de développement

## Prérequis #

* NodeJS 10.X

## Utilisation dans un projet #

Ajouter au package.json

```shell
  "dependencies": {
    "hornet-js-core": "5.5.X"
  }
```

Puis lancer la commande :

```shell
npm install
```

### Actions

Les actions sont exécutées côté serveur et portent les traitements de l’application. Les services externes sont appelés depuis les actions afin d’effectuer les traitements demandés par l’utilisateur.

Chaque **action** doit être une fonction retournant une `Promise` effectuant l’action à proprement parler (au sens métier). Ce fonctionnement est nécessaire afin de permettre au `routeur` :

* de savoir quand effectuer le rendu de la page côté serveur.
* de pouvoir désactiver les actions lors du premier affichage de la page côté client pour éviter un double appel des API externes (serveur puis client).


#### Routeur

Ce composant est le point central de la navigation. Il permet de gérer de manière identique la navigation au sein de l’application que ce soit côté client (avec ou sans JavaScript) ou côté serveur.

Ce composant est configuré à partir d’un ensemble de « routes » qui viennent faire le lien entre une URL et les actions du pattern (dans son implémentation isomorphe).

Le routeur d'Hornet s'appuie sur le composant [Director](http://github.com/flatiron/director).

Les particularités :

* Transmission des données `POST` par une méthode spécifique afin de ne pas modifier l’url du navigateur
* Utilisation du mode « historique » html5 (mode `pushState` à la place de la notation `!#`) afin d’uniformiser les urls entre la partie client et serveur.

### Vues

Les vues sont les composants servant à produire le code html affiché à l'utilisateur.

Les composants de cette brique utilisent le moteur de rendu [React](http://facebook.github.io/react/) :

## Licence

`hornet-js-core` est sous [licence cecill 2.1](./LICENSE.md).

Site web : [http://www.cecill.info](http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.html)

---
_Source: https://npm.io/package/hornet-js-core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
