# Namespace

> Standard library namespace.

<section class="usage">

## Usage

```javascript
var namespace = require( '@stdlib/namespace' );
```

#### namespace()

Returns the standard library namespace.

```javascript
var ns = namespace();
// returns [ {...}, {...}, ... ]
```

</section>

<!-- /.usage -->

<section class="examples">

## Examples

<!-- TODO: better example. Possibly adding to global namespace as was done in previous example. Can see REPL context generation for inspiration. -->

<!-- eslint no-undef: "error" -->

```javascript
var namespace = require( '@stdlib/namespace' );

var ns = namespace();
// returns [ {...}, {...}, ... ]
```

</section>

<!-- /.examples -->

<!-- Section for describing a command-line interface. -->

* * *

<section class="cli">

## CLI

<!-- CLI usage documentation. -->

<section class="usage">

### Usage

```text
Usage: stdlib-namespace [options]

Options:

  -h,    --help                Print this message.
  -V,    --version             Print the package version.
         --fields f1,f2,...    Print fields as CSV.
```

</section>

<!-- /.usage -->

<!-- CLI usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="notes">

### Notes

-   The default output format is newline-delimited JSON ([NDJSON][ndjson]). Each printed `object` will contain the following fields: `alias`, `path`, `type`, and `related`. If a namespace element's value can be serialized as [JSON][json], the `object` will contain the element `value`. Otherwise, the `value` field will be missing.
-   To output data as comma-separated values ([CSV][csv]), specify the desired fields. Supported fields include: `alias`, `path`, `type`, and `related`. The first line is a header line, and all values are enclosed in double quotes `"..."`.

</section>

<!-- /.notes -->

<!-- CLI usage examples. -->

<section class="examples">

### Examples

```bash
$ stdlib-namespace
{...}
{...}
{...}
...
```

To output data as [CSV][csv],

```bash
$ stdlib-namespace --fields alias,type
"alias","type"
"AFINN_111","Function"
"AFINN_96","Function"
"any","Function"
"anyBy","Function"
...
```

</section>

<!-- /.examples -->

</section>

<!-- /.cli -->

<section class="links">

[csv]: https://tools.ietf.org/html/rfc4180

[json]: http://www.json.org/

[ndjson]: http://specs.frictionlessdata.io/ndjson/

</section>

<!-- /.links -->
