---
title: "package(path:traits:)"
framework: packagedescription
role: symbol
role_heading: Type Method
path: "packagedescription/package/dependency/package(path:traits:)"
---

# package(path:traits:)

Adds a local dependency to a package located at the path and with an optional set of traits you provide.

## Declaration

```swift
static func package(path: String, traits: Set<Package.Dependency.Trait> = [.defaults]) -> Package.Dependency
```

## Parameters

- `path`: The file system path to the package.
- `traits`: The trait configuration of this dependency. The default value enables the default traits of the package.

## Return Value

Return Value A package dependency.

## Discussion

Discussion The Swift Package Manager uses the package dependency as-is and does not perform any source control access. Local package dependencies are especially useful during development of a new package or when working on multiple tightly coupled packages.

## See Also

### Creating a local dependency

- [package(name:path:)](packagedescription/package/dependency/package(name:path:).md)
- [package(name:path:traits:)](packagedescription/package/dependency/package(name:path:traits:).md)
- [package(path:)](packagedescription/package/dependency/package(path:).md)
