New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mongoslug

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongoslug

Save unique slug in mongodb

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

mongoslug

Save unique slug in mongodb

Usage/Examples

  var slug = await mongoslug({ title: projecttitle, modelname: Project });

const Project = require("../model/projects");
const { mongoslug } = require("mongoslug");

exports.start = async (req, res) => {
  var { projectname, userid } = req.params;
  /* getting name and bio from user */
  var slug = await mongoslug({ title: projectname, modelname: Project });

  if (slug) {
    let newProject = new Project({
      projectname: projectname,
      postedBy: userid,
      slug: slug,
    });
    newProject.save((err, data) => {
      if (err) {
        return res.status(400).json({
          error: err,
        });
      } else {
        res.json(data);
        console.log(data);
      }
    });
  }
};

Keywords

mongoslug

FAQs

Package last updated on 27 Dec 2022

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