pubspec_lock_parse
पबस्पेक.लॉक फ़ाइलों को पार्स करने के लिए एक सरल पैकेज, जिसमें टाइप-सुरक्षित API और समृद्ध त्रुटि रिपोर्टिंग है।
पबस्पेक.लॉक फ़ाइलों को पार्स करने के लिए सरल पैकेज, जिसमें प्रकार सुरक्षित API और समृद्ध त्रुटि रिपोर्टिंग है।
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
Supports parsing pubspec.lock files with robust error reporting
Designed around the pubspec_parse package, and mirrors its implementation and interface
import 'dart:io';
import 'package:pubspec_lock_parse/pubspec_lock_parse.dart';
void main() {
final lockStr = File('path/to/pubspec.lock').readAsStringSync();
final lockfile = PubspecLock.parse(lockStr);
}
You can find more about the PubspecLock object in the documentation here
pubspec_lock_parse includes .toJson() methods on each object to allow for easy re-generation/mutation of pubspec files
This can be combined with yaml_writer to re-generate yaml output
void main() {
final pubspec = PubspecLock(
packages: {
'somePackage': Package(
dependency: 'transitive',
description: PathPackageDescription(
path: '../somePackage',
relative: true,
)
)
},
sdks: {
'dart': VersionConstraint.parse(">=2.17.0 <3.0.0"),
}
);
final jsonPubspec = pubspec.toJson(); // outputs Map<String, dynamic>
final yamlPubspec = YamlWriter().write(jsonPubspec); // outputs String
}
toJson can also be run on any individual object
// outputs: { path: '../somePackage', relative: true }
print(PathPackageDescription(
path: '../somePackage',
relative: true,
).toJson());
निर्भरता सूची 9 आइटम
^2.3.1^4.6.0^2.1.1^2.0.1^2.1.11^6.3.1^1.21.4^1.10.0^3.1.1उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗