패키지, 저장소 및 앱 카테고리 검색

GitHub 저장소matthewnitschke/pubspec_lock_parse

pubspec_lock_parse

pubspec.lock 파일을 파싱하기 위한 간단한 패키지로, 타입 안전한 API와 풍부한 오류 보고 기능을 제공합니다.

pubspec_lock_parse 프로젝트 이미지
스타
5
포크
2
최근 푸시(UTC)
2022. 10. 15.
프로젝트 상태
활성

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

Dart pub package

Supports parsing pubspec.lock files with robust error reporting

Designed around the pubspec_parse package, and mirrors its implementation and interface

Usage

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

toJson() methods

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());
Matthew GitHub avatar
GitHub 작성자

Matthew ↗

Dedicated to overengineering solutions to problems no one has

언어Dart

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 9 개

프로젝트에 맞는 저장소를 선택하려면?

사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.

  1. 이름, 작성자 또는 설명으로 검색하고 기술 주제로 범위를 좁힙니다.
  2. 스타, 포크, 최근 푸시를 함께 비교하세요. 스타는 관심의 지표이며 품질을 보장하지 않습니다.
  3. 사용하기 전에 GitHub에서 README, 라이선스, Issues를 확인하세요.

출처 및 관리

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗