# nexusapi

> Access data from Nexus repositories

Latest version **1.4.2** (published 2016-06-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install nexusapi
pnpm add nexusapi
yarn add nexusapi
bun add nexusapi
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.2 |
| Published | 2016-06-28 |
| First published | 2016-06-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ~4.4.4 |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Don Payne |
| Maintainers | donpayne |

## Links

- npm: https://www.npmjs.com/package/nexusapi
- Repository: https://github.com/donpayne/nexusapi
- Homepage: https://github.com/donpayne/nexusapi#readme
- Issues: https://github.com/donpayne/nexusapi/issues
- npm.io page: https://npm.io/package/nexusapi

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.13.1
- [request](https://npm.io/package/request.md) ^2.72.0
- [bluebird](https://npm.io/package/bluebird.md) ^3.0.6

## Recent versions

- 1.4.2 (latest) — 2016-06-28
- 1.4.1 — 2016-06-21
- 1.4.0 — 2016-06-21
- 1.3.0 — 2016-06-21

## README

# Nexus API

##
This is a module that sends http requests to Nexus and returns an object with an array of artifacts for a give repository.

## Installation

### npm

Install the module via npm specifying a version.

	$ npm install nexusapi --save

### package.json

The npm command above will update the application's package.json file with a dependency.

	...
	"dependencies": {
		"nexusapi": "~1.4.1"
	},
	...

### nexusapi.getContent

The object is a function that is expecting config parameters to be passed.
	
	// Modules
	var nexusapi = require('nexusapi')(
	{
		url   : 'https://mynexusserver.com/repomgr/service/local/repositories',
		repo  : 'SomeRepo'
	});

	// Get Content
	module.exports = function ()
	{
		// Get top level nexusapi.getContent()
		// Get group level nexusapi.getContent('SomeGroup')
		// Get group/artifact level nexusapi.getContent('SomeGroup', 'SomeArtifact')

		return nexusapi.getContent().then(function (data)
		{
			return data;
		}).catch(function (err)
		{
			throw err;
		});
	};

### return value

The module will return an array of artifacts.

	[
		{
			"resourceURI": "https://mynexusserver.com/repomgr/service/local/repositories/SomeRepo/content/SomeGroup/",
			"relativePath": "/SomeGroup/",
			"text": "SomeGroup",
			"leaf": false,
			"lastModified": "2016-05-03 01:33:18.0 UTC",
			"sizeOnDisk": -1
		}
	]

### nexusapi.getVersions

The object is a function that is expecting config parameters to be passed.
	
	// Modules
	var nexusapi = require('nexusapi')(
	{
		url   : 'https://mynexusserver.com/repomgr/service/local/repositories',
		repo  : 'SomeRepo'
	});

	// Get Versions
	module.exports = function ()
	{
		// Get group/artifact level nexusapi.getVersions('SomeGroup', 'SomeArtifact')

		return nexusapi.getVersions().then(function (data)
		{
			return data;
		}).catch(function (err)
		{
			throw err;
		});
	};

### return value

The module will return an array of versions.

	[
		'1.0.0',
		'1.1.0',
		'2.0.0'
	]

### nexusapi.getLatestVersion

The object is a function that is expecting config parameters to be passed.
	
	// Modules
	var nexusapi = require('nexusapi')(
	{
		url   : 'https://mynexusserver.com/repomgr/service/local/repositories',
		repo  : 'SomeRepo'
	});

	// Get Latest Version
	module.exports = function ()
	{
		// Get group/artifact level nexusapi.getLatestVersion('SomeGroup', 'SomeArtifact')

		return nexusapi.getLatestVersion().then(function (val)
		{
			return val;
		}).catch(function (err)
		{
			throw err;
		});
	};

### return value

The module will return a single version.

	'2.0.0'

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