Skip to content

jeasonstudio/hfm

Repository files navigation

HFM

travis npm downloads

Simple, programmatic hosts file manager. Just like nrm.

Install

npm install hfm -g

Usage

If you use OS X or Linux, this module assumes your hosts file is at /etc/hosts. On Windows, it assumes your hosts file is at C:/Windows/System32/drivers/etc/hosts.

help

Print help message for hfm

$ hfm help

  Usage: hfm [options] [command]

  Options:

    -V, --version         output the version number
    -h, --help            output usage information

  Commands:

    list|ls               List origin or local host files alias
    show                  Show all current domain records in hosts file
    alias <name> <path>   Alias a(n) origin/local host file
    del <name>            Unalias a(n) origin/local host file
    set <ip> <domain...>  Set a domain in the hosts file
    remove <domain...>    Remove a set of host entries from URL or local path
    search <domain>       Search related domain records in hosts file
    use <alias>           Use a(n) origin hosts path or an ALIAS_NAME(see `hfm ls`)
    unuse <alias>         Unuse a(n) origin hosts path or an ALIAS_NAME(see `hfm ls`)
    help                  Print help for hfm

list|ls

List origin or local host files alias

$ ./bin/cli.js ls
* Google        https://raw.githubusercontent.com/googlehosts/hosts/master/hosts-files/hosts
* GoogleMirror  https://coding.net/u/scaffrey/p/hosts/git/raw/master/hosts-files/hosts

show

Show all current domain records in hosts file

$ hfm show
# ----------------------------
# SYSTEM
127.0.0.1       localhost
255.255.255.255 broadcasthost

set [ip] [domain]

Set a domain in the hosts file

remove [domain]

Remove a set of host entries from URL or local path

alias [name] [path]

Alias a(n) origin/local host file
path could be local path or URL

del [name]

Unalias a(n) origin/local host file

search [domain]

Search related domain records in hosts file

$ hfm search \.com$
$ hfm search google.*
$ hfm search www.google.com

use [alias]

Use a(n) origin hosts path or an ALIAS_NAME(see hfm ls)

$ hfm use Google

unuse [alias]

Unuse a(n) origin hosts path or an ALIAS_NAME(see hfm ls)

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy