pub struct PackageJson {
pub exports: Option<Map<String, Value>>,
pub imports: Option<Map<String, Value>>,
pub bin: Option<Value>,
pub name: Option<String>,
pub version: Option<String>,
pub path: PathBuf,
pub typ: String,
pub types: Option<String>,
pub dependencies: Option<IndexMap<String, String>>,
pub dev_dependencies: Option<IndexMap<String, String>>,
pub scripts: Option<IndexMap<String, String>>,
pub workspaces: Option<Vec<String>>,
/* private fields */
}Fields§
§exports: Option<Map<String, Value>>§imports: Option<Map<String, Value>>§bin: Option<Value>§name: Option<String>§version: Option<String>§path: PathBuf§typ: String§types: Option<String>§dependencies: Option<IndexMap<String, String>>§dev_dependencies: Option<IndexMap<String, String>>§scripts: Option<IndexMap<String, String>>§workspaces: Option<Vec<String>>Implementations§
Source§impl PackageJson
impl PackageJson
pub fn load_from_path( path: &Path, fs: &dyn DenoPkgJsonFs, maybe_cache: Option<&dyn PackageJsonCache>, ) -> Result<Rc<PackageJson>, PackageJsonLoadError>
pub fn load_from_string( path: PathBuf, source: String, ) -> Result<PackageJson, PackageJsonLoadError>
pub fn load_from_value(path: PathBuf, package_json: Value) -> PackageJson
pub fn specifier(&self) -> Url
pub fn dir_path(&self) -> &Path
pub fn main(&self, referrer_kind: NodeModuleKind) -> Option<&str>
Sourcepub fn resolve_local_package_json_deps(
&self,
) -> IndexMap<String, Result<PackageJsonDepValue, PackageJsonDepValueParseError>>
pub fn resolve_local_package_json_deps( &self, ) -> IndexMap<String, Result<PackageJsonDepValue, PackageJsonDepValueParseError>>
Resolve the package.json’s dependencies.
Trait Implementations§
Source§impl Clone for PackageJson
impl Clone for PackageJson
Source§fn clone(&self) -> PackageJson
fn clone(&self) -> PackageJson
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PackageJson
impl Debug for PackageJson
Source§impl Serialize for PackageJson
impl Serialize for PackageJson
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for PackageJson
impl RefUnwindSafe for PackageJson
impl Send for PackageJson
impl Sync for PackageJson
impl Unpin for PackageJson
impl UnwindSafe for PackageJson
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more