Skip to content

lightship-core/lightship-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lightship-node

Requirements

Installation

npm install @lightship/lightship

Usage

import {
  audit,
  contentSecurityPolicyRule,
  permissionsPolicyRule,
  referrerPolicyRule
  strictTransportSecurityRule,
  xContentTypeOptionsRule,
  xFrameOptionsRule,
} from "@lightship/lightship";

const auditResponse = await audit({
  url: "http://localhost:8000",
  rules: {
    seo: [],
    security: [
      contentSecurityPolicyRule,
      permissionsPolicyRule,
      referrerPolicyRule
      strictTransportSecurityRule,
      xContentTypeOptionsRule,
      xFrameOptionsRule,
    ]
  }
});

console.log(auditResponse);
{
  "url": "http://localhost:8000",
  "durationInSeconds": 0.007,
  "score": {
    "seo": 0,
    "security": 33
  },
  "seo": [],
  "security": [
    {
      "name": "content-security-policy",
      "passes": true
    },
    {
      "name": "permissions-policy",
      "passes": false
    },
    {
      "name": "referrer-policy",
      "passes": false
    },
    {
      "name": "strict-transport-security",
      "passes": true
    },
    {
      "name": "x-content-type-options",
      "passes": false
    },
    {
      "name": "x-frame-options",
      "passes": false
    }
  ]
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published