Skip to content

Commit

Permalink
Drop support for standalone bundling
Browse files Browse the repository at this point in the history
- remove bundling
- remove build script
- change documentation accordingly
  • Loading branch information
Enet4 committed Oct 11, 2023
1 parent a2bcd22 commit 50fd941
Show file tree
Hide file tree
Showing 6 changed files with 7,581 additions and 116 deletions.
10 changes: 0 additions & 10 deletions .babelrc

This file was deleted.

36 changes: 12 additions & 24 deletions README.docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,19 @@ Documentation was built from our TypeScript definitions, and should be automatic

## Installing

### Node.js or Browser with bundling
### Node.js

Install "dicoogle-client" with `npm` and
import the _default_ export or the named export `dicoogleClient`
from the _"dicoogle-client"_ module.
Install `dicoogle-client` with `npm` and
import the _default_ export or the named export `dicoogleClient`.
This works both in JavaScript and in TypeScript.

```javascript
import dicoogleClient from 'dicoogle-client';
```

When not using ECMAScript modules (CommonJS environment),
When not using ECMAScript modules (e.g. using CommonJS),
you need to use an interoperability layer such as [Babel](https://babeljs.io).
Otherwise, the module can be imported manually:
Otherwise, the module will need to be imported dynamically:

```javascript
import('dicoogle-client')
Expand All @@ -38,21 +37,12 @@ import('dicoogle-client')
});
```

### On the browser, no module system
### On a Browser with Bundling

When _not_ using Node.js or any bundling system,
you can build the distributable bundle by running:

```sh
npm run build
```

Then include the "dist/dicoogle-client.min.js" file as a script,
thus exposing the `DicoogleClient` module as a global variable.

```html
<script src='path/to/my/libs/dicoogle-client.min.js'></script>
```
Install and use `dicoogle-client` like in Node.js.
The library includes a few uses of `process.env.NODE_ENV`,
which will need to be replaced in a browser environment.
See an example of this using webpack [here](https://webpack.js.org/plugins/environment-plugin/#root).

## Basic Usage

Expand Down Expand Up @@ -106,7 +96,5 @@ dicoogle.login('admin', 'mysecretpassword', function(error, outcome) {

## Examples

The repository includes two examples of dicoogle-client for simple querying:

- "bin/dicoogle-query-cli.js" is a complete stand-alone Node.js application for querying Dicoogle. This is the source code of the `dicoogle-query` executable.
- "example/app.html" is a web page demonstrating simple querying.
- "bin/dicoogle-query-cli.js" is a complete stand-alone Node.js application for querying Dicoogle.
This is the source code of the `dicoogle-query` executable.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
This is a web service client API to [Dicoogle](http://www.dicoogle.com), the open-source PACS archive, for use in JavaScript applications.
This library is compatible with browser-based JavaScript and Node.js. A CLI application for searching medical images in Dicoogle is also included (`dicoogle-query`).

This library is compatible with Dicoogle versions `>=2.0.0 <3.3.3`,
This library intends to be fully compatible with Dicoogle versions 2 and 3,
and may be updated as future versions of Dicoogle are released.

## Using the JavaScript API
Expand Down
63 changes: 0 additions & 63 deletions gulpfile.js

This file was deleted.

Loading

0 comments on commit 50fd941

Please sign in to comment.