Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 7, 2024 via pnpm

psl 1.9.0

Domain name parser based on the Public Suffix List
Package summary
Share
0
issues
1
license
1
MIT
Package created
14 Oct 2014
Version published
4 Jul 2022
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
psl@1.9.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of psl 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does psl do?

PSL (Public Suffix List) is a JavaScript-based domain name parser leveraging the Public Suffix List, a cross-vendor initiative providing a comprehensive list of domain name suffixes. This library allows developers to parse domain names accurately to extract information like top-level domain (TLD), second-level domain (SLD), the full domain name, and any optional subdomains. This tool serves as a vital resource in various software but was primarily intended to aid browser manufacturers' needs.

How do you use psl?

To employ PSL in your projects, follow these steps:

  1. Install the package using npm with the following command:
npm install --save psl
  1. In your JavaScript file, require the 'psl' module and use its functions. Here are examples of how to use different functions:

    • Parse a domain:
    var psl = require('psl');
    
    var parsed = psl.parse('www.google.com');
    console.log(parsed.tld); // 'com'
    console.log(parsed.sld); // 'google'
    console.log(parsed.domain); // 'google.com'
    console.log(parsed.subdomain); // 'www'
    
    • Get a domain name
    var psl = require('psl');
    
    var domain = psl.get('www.example.COM'); 
    console.log(domain); // 'example.com'
    
    • Check if a domain has a valid Public Suffix using the isValid function:
    var psl = require('psl');
    
    var isValid = psl.isValid('google.com');
    console.log(isValid); // true
    

Where are the psl docs?

The documentation for PSL can be found directly in its README file on the GitHub repository. It provides a comprehensive guide on installing and using this module, including function usage and code examples. The Public Suffix List, on which psl is based, is also explained in detail on publicsuffix.org.