# caroot

> Replaces a caret with the root path

Latest version **1.1.0** (published 2015-09-28) · MIT license · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2015-09-28 |
| First published | 2015-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Maurice Butler |
| Maintainers | mauricebutler |
| Keywords | caret, root, require, resolve, package, json, rootify, rooty |

## Links

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

## Dependencies (1)

- [find-root](https://npm.io/package/find-root.md) ^0.1.1

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.1.0 (latest) — 2015-09-28
- 1.0.0 — 2015-09-07

## README

# caroot

Replaces a caret with the root path (closest package.json)

# Usage

caroot(caretedPath, currentPath[, rootSubDirectory])

```javascript

var caroot = require('caroot');

// assume we are 2 levels deeper than package.json

caroot('^foo', __dirname);

// returns '../../foo'


// also takes an optional root sub directory

caroot('^foo', __dirname, './scripts');

// returns '../foo'

```

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