Socket
Socket
Sign inDemoInstall

@ladjs/store-ip-address

Package Overview
Dependencies
3
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ladjs/store-ip-address

Stores user's IP address in the background for Lad


Version published
Maintainers
1
Install size
398 kB
Created

Readme

Source

@ladjs/store-ip-address

build status code coverage code style styled with prettier made with lass license

Stores user's IP address in the background for Lad

Table of Contents

Install

npm:

npm install @ladjs/store-ip-address

yarn:

yarn add @ladjs/store-ip-address

Usage

With standard logger:

App:

const StoreIPAddress = require('@ladjs/store-ip-address');

// ...

const storeIPAddress = new StoreIPAddress();
app.use(storeIPAddress.middleware);

Mongoose user model:

const storeIPAddress = new StoreIPAddress();
User.plugin(storeIPAddress.plugin);

With custom logger instance:

App:

const StoreIPAddress = require('@ladjs/store-ip-address');
const Logger = require('@ladjs/logger');

// ...

const storeIPAddress = new StoreIPAddress({ logger: new Logger() });
app.use(storeIPAddress.middleware);

With custom fields to store on user model instead of ip and last_ips:

App:

const StoreIPAddress = require('@ladjs/store-ip-address');
const Logger = require('@ladjs/logger');

// ...

const storeIPAddress = new StoreIPAddress({
  ip: 'ip_address',
  lastIps: 'last_ip_addresses'
});

app.use(storeIPAddress.middleware);

Mongoose user model:

const storeIPAddress = new StoreIPAddress({
  ip: 'ip_address',
  lastIps: 'last_ip_addresses'
});

User.plugin(storeIPAddress.plugin);

Contributors

NameWebsite
Nick Baughhttp://niftylettuce.com/

License

MIT © Nick Baugh

Keywords

FAQs

Last updated on 10 Dec 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc