[−][src]Struct npm_package_json::Package
The top-level package.json
structure.
Fields
name: String
The package name.
version: String
The package version.
description: Option<String>
The optional package description.
keywords: Vec<String>
The optional list of keywords.
homepage: Option<String>
The optional package homepage.
bugs: Option<Bug>
The optional bug contact form.
license: Option<String>
The optional package license.
The optional author.
contributors: Vec<PersonReference>
The optional list of contributors.
files: Vec<String>
The optional list of files to include. Each entry defines a regex pattern.
main: Option<String>
The optional package main entry file.
browser: Option<String>
The optional package browser entry file.
This is usually defined in libraries that are meant to be consumed by
browsers. These Thoes can refer to objects that are not available inside
a nodejs
environment (like window
).
bin: BinSet
The optional set of binary definitions.
man: Option<ManReference>
The optional list of man page references.
repository: Option<RepositoryReference>
The optional repository reference.
scripts: ScriptsSet
The optional list of script entries.
dependencies: DepsSet
The optional list of dependencies.
dev_dependencies: DepsSet
The optional list of development dependencies.
peer_dependencies: DepsSet
The optional list of peer dependencies.
bundled_dependencies: DepsSet
The optional list of bundled dependencies.
optional_dependencies: DepsSet
The optional list of optional dependencies.
engines: EnginesSet
The optional list of engine entries.
private: bool
The package privacy.
others: BTreeMap<String, Value>
Other custom fields that have been defined inside the package.json
file.
Implementations
impl Package
[src]
pub fn new() -> Self
[src]
Creates a new default package.
pub fn from_path(path: impl AsRef<Path>) -> Result<Self>
[src]
Deserializes a Package
from a file path.
pub fn from_reader<R: Read>(r: R) -> Result<Self>
[src]
Deserializes a Package
from an IO stream.
pub fn from_slice(v: &[u8]) -> Result<Self>
[src]
Deserializes a Package
from bytes.
Trait Implementations
impl Clone for Package
[src]
impl Debug for Package
[src]
impl Default for Package
[src]
impl<'de> Deserialize<'de> for Package
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Package
[src]
impl FromStr for Package
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
Deserializes a Package
from a string.
impl PartialEq<Package> for Package
[src]
impl Serialize for Package
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Package
[src]
impl StructuralPartialEq for Package
[src]
Auto Trait Implementations
impl RefUnwindSafe for Package
impl Send for Package
impl Sync for Package
impl Unpin for Package
impl UnwindSafe for Package
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,