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

@lpgroup/import-cli

Package Overview
Dependencies
Maintainers
2
Versions
194
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lpgroup/import-cli

Cli command that imports data into rest api, RabbitMQ server and NATS.

latest
Source
npmnpm
Version
1.10.2
Version published
Maintainers
2
Created
Source

@lpgroup/import-cli

npm version Known Vulnerabilities Licence MIT tested with jest codecov

Cli command that imports data into rest-api, RabbitMQ and NATS.

Install

Installation of the npm

npm install @lpgroup/import-cli

Configuration

.import.json

{
  "environments": {
    "default": {
      "http": {
        "server": "https://api.thecatapi.com/v1/",
        "user": "",
        "password": "",
        "readyServer": "https://api.thecatapi.com/",
        "headers": { "x-api-key": "446825e1-284d-4d4d-8fc7-7556636211ad" }
      },
      "nats": {
        "uri": "nats://localhost:4222",
        "queue": "import-js",
        "messagePrefix": "int",
        "version": "v2"
      },
      "rabbitmq": {
        "uri": "amqps://user:password@xxxx.cloudamqp.com/user",
        "queue": "dev"
      }
    }
  },
  "requiredKeys": ["owner", "added", "changed", "url"],
  "ignoreKeyCompare": ["_id", "owner", "added", "changed", "url"]
}

Example

Add the following to import/10-votes.js.

import { axios } from "@lpgroup/import-cli";

export default async () => {
  return axios().then(async (ax) => {
    await ax.post(
      "/votes",
      {
        image_id: "good-cat",
        sub_id: "my-user-1234",
        value: 1,
      },
      {
        expected: {
          image_id: "good-cat",
          sub_id: "my-user-1234",
          value: 1,
        },
        noArraySort: true,
        ignoreError: false,
        ignoreKeyCompare: ["_id"],
        requiredKeys: ["changed"],
      },
    );
  });
};

Test Keys API:

KeysTypeDescription
noArraySortboolean
ignoreErrorboolean
ignoreKeyComparearray
requiredKeysarray
expectedobjectcompares expected and actual response
expectedFilestring/expected/testFileName/{expectedFile}-method-expected
writeRequestboolean/falseexpectedFile, will write the request if has diff
writeDiffboolean/falseexpectedFile, will write if has diff
writeOriginalboolean/trueexpectedFile, will write original, if has diff,

Add the follwing script to package.json.

{
  "scripts": {
    "import": "import-cli -v -e default -w import/"
  }
}

Run script from command line.

npm run import -- -i 10-votes

Development

yarn jest -- import-cli
yarn workspace @lpgroup/import-cli lpimport

Contribute

See contribute

License

MIT - See licence

Keywords

import

FAQs

Package last updated on 09 Oct 2025

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