dotf
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

dotf Build Status npm Version

Manage multiple dotfiles.

npm i dotf

Features

  • Supports multiple dotfiles
  • Absolute or relative dotfiles

Example

import dotf from 'dotf';

// Setup dotfiles
let dotglobal = dotf('~', 'myrc'); // Global (~)
let dotlocal = dotf(__dirname, 'myignore'); // Local (./)

// Write
let overwriteGlobal = await dotglobal.write({ myGlobal: 1337 });
let overwriteLocal = await dotlocal.write({ myLocal: 2674 });

// Exists
let globalExists = await dotglobal.exists();
let localExists = await dotlocal.exists();

// Read
let globalRead = await dotglobal.read();
let localRead = await dotlocal.read();

Why not use XXX instead?

  • I didn't see support for custom paths in dotfile in other packages (i.e. /dotfile).
  • This module provides 1 liner read/write/existance with the modern await syntax.

Tests (ava)

npm i
npm test

/dotf/

    Package Sidebar

    Install

    npm i dotf

    Weekly Downloads

    11,520

    Version

    2.0.2

    License

    MIT

    Unpacked Size

    7.55 kB

    Total Files

    6

    Last publish

    Collaborators

    • grant
    • shinout
    • popgoesthewza