Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

check-magic

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

check-magic

Manage your check.txt file with magic!

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

check-magic

Manage your app's status with a file.

Constructor

CheckMagic( [options] )

options is an optional object that can contain:

{
	"offline": "maintenance",
	"online": "production",
	"path": "./check.txt",
	"leave": false,
	"startOffline": false
}
offline:

The string that will be written to check.txt when your app is offline. Defaults to maintenance

online:

The string that will be written to check.txt when your app is online. Defaults to production

path:

The path to check.txt. Defaults to ./check.txt

leave:

If leave is not set to true, CheckMagic will remove check.txt when the process exits. Defaults to false

startOffline:

If startOffline is not set to true, you will need to call goOnline to indicate your server is online. Defaults to false

Methods

getStatus()

Returns the contents of check.txt as a string. If check.txt is inaccessible it will return your offline string.

goOffline()

Writes your offline string to check.txt

goOnline()

Writes your online string to check.txt

FAQs

Package last updated on 13 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc