Skip to content

kirkeaton/read-pubspec

Folders and files

NameName
Last commit message
Last commit date
Mar 17, 2025
Dec 22, 2024
Dec 22, 2024
Oct 4, 2020
Apr 24, 2024
Mar 18, 2024
Mar 26, 2024
Oct 3, 2020
Dec 25, 2024
Mar 27, 2025
Mar 27, 2025
Jan 17, 2025
Dec 22, 2024
Dec 22, 2024

Repository files navigation

read-pubspec

Read a pubspec.yaml file

Install

$ npm install read-pubspec

Usage

import path from 'node:path';
import { readPubspec } from 'read-pubspec';

process.chdir(path.join(__dirname, '/test'));

console.log(await readPubspec());
//=> { name: 'root', … }

console.log(await readPubspec({ cwd: path.join(process.cwd(), '/sub') }));
//=> { name: 'sub', … }

API

readPubspec(options?)

Returns a Promise<Pubspec> with the parsed YAML.

options

Type: ReadPubspecOptions

options.cwd

Type: string
Default: process.cwd()

Current working directory