🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

codep

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

codep

Copy your frontend dependencies directly into your assets

1.0.2
unpublished
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

CoDep

Copy your frontend dependencies directly into your assets.

Features

  • Fast
  • CLI support
  • Creating non-existent output directories
  • User-friendly error messages
  • Customable reporting

Install

npm i -D codep

Usage

import { Codep } from "codep"

await new Codep("assets/vendor", {
  exclude: ["jquery", "modernizr"]
}).paste()

API

const codep = new Codep(outDir, options?)

outDir

Type : string

Specify an output folder for all copied files

options

Type: object

PropertyTypeDefaultDescription
sourcestringnode_modulesSpecify the node modules directory
pkgstringpackage.jsonSpecify the json file location
flattenDistbooleantrueKeep the dist folder or flatten in the root folder from each dependency
excludestring|array[]Specify the name of the dependencies you don't want to copy, e.g. ['jquery', 'modernizr']
extstring|arrayOnly copied files with the specified extension. Use * to grab all files from dependencies
overwritebooleanfalseDo you want to overwrite existing dependencies in the outdir?
devDependenciesbooleanfalseShould you need to grab devDependencies as well?

ext Default: js,jsx,ts,tsx,css,scss,less,stylus,map,eot,woff,woff2,ttf,svg,png,jpg,jpeg

codep.paste()

Write source files to outDir asynchronously.

;(async () => {
  await codep.paste()
})()

Optimizations

Handle progress reports the way you want.

import { Codep } from "codep"

// initialize Codep
const codep = new Codep("assets/vendor", {
  exclude: ["jquery", "modernizr"]
})

// handle reports or just ignore this block
codep.on("progress", data => {
  // doing things on progress
})

// copying
;(async () => {
  try {
    await codep.paste()
  } catch (error) {
    throw error
  }
})()

codep.on('progress', handler)

handler(data)

Type: Function

data

Type: Manifest

Manifest is an object with properties below:

PropertyType
successnumber
failednumber
processednumber
percentstring
vendorsstring[]
totalFilesnumber
logLog

Keywords

copy

FAQs

Package last updated on 29 Oct 2021

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