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

@poppinss/file-generator

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@poppinss/file-generator - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0-0

build/src/files/csv/generate.d.ts

13

build/index.d.ts

@@ -1,6 +0,7 @@

export { generateDocx } from './src/files/docx';
export { generateGif } from './src/files/gif';
export { generateJpg } from './src/files/jpg';
export { generatePdf } from './src/files/pdf';
export { generatePng } from './src/files/png';
export { generateXlsx } from './src/files/xlsx';
export { generateDocx } from './src/files/docx/generate.js';
export { generateGif } from './src/files/gif/generate.js';
export { generateJpg } from './src/files/jpg/generate.js';
export { generatePdf } from './src/files/pdf/generate.js';
export { generatePng } from './src/files/png/generate.js';
export { generateXlsx } from './src/files/xlsx/generate.js';
export { generateCsv } from './src/files/csv/generate.js';

@@ -1,23 +0,7 @@

"use strict";
/*
* @poppinss/file-generator
*
* (c) Poppinss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateXlsx = exports.generatePng = exports.generatePdf = exports.generateJpg = exports.generateGif = exports.generateDocx = void 0;
var docx_1 = require("./src/files/docx");
Object.defineProperty(exports, "generateDocx", { enumerable: true, get: function () { return docx_1.generateDocx; } });
var gif_1 = require("./src/files/gif");
Object.defineProperty(exports, "generateGif", { enumerable: true, get: function () { return gif_1.generateGif; } });
var jpg_1 = require("./src/files/jpg");
Object.defineProperty(exports, "generateJpg", { enumerable: true, get: function () { return jpg_1.generateJpg; } });
var pdf_1 = require("./src/files/pdf");
Object.defineProperty(exports, "generatePdf", { enumerable: true, get: function () { return pdf_1.generatePdf; } });
var png_1 = require("./src/files/png");
Object.defineProperty(exports, "generatePng", { enumerable: true, get: function () { return png_1.generatePng; } });
var xlsx_1 = require("./src/files/xlsx");
Object.defineProperty(exports, "generateXlsx", { enumerable: true, get: function () { return xlsx_1.generateXlsx; } });
export { generateDocx } from './src/files/docx/generate.js';
export { generateGif } from './src/files/gif/generate.js';
export { generateJpg } from './src/files/jpg/generate.js';
export { generatePdf } from './src/files/pdf/generate.js';
export { generatePng } from './src/files/png/generate.js';
export { generateXlsx } from './src/files/xlsx/generate.js';
export { generateCsv } from './src/files/csv/generate.js';
{
"name": "@poppinss/file-generator",
"version": "1.0.2",
"version": "2.0.0-0",
"description": "Generate in-memory fake files for custom size",
"main": "build/index.js",
"type": "module",
"files": [

@@ -10,24 +12,18 @@ "build/src",

],
"types": "./build/index.d.ts",
"exports": {
".": {
"types": "./build/index.d.ts",
"require": "./build/index.js"
}
".": "./build/index.js"
},
"scripts": {
"mrm": "mrm --preset=@adonisjs/mrm-preset",
"pretest": "npm run lint",
"test": "node -r @adonisjs/require-ts/build/register bin/test.ts",
"test": "node --loader=ts-node/esm bin/test.ts",
"clean": "del-cli build",
"copy:images": "copyfiles 'src/files/**/*{.png,.gif,.jpg,.pdf,.docx,.xlsx}' build",
"compile": "npm run lint && npm run clean && tsc && npm run copy:images",
"copy:files": "copyfiles 'src/files/**/*{.png,.gif,.jpg,.pdf,.docx,.xlsx}' build",
"compile": "npm run lint && npm run clean && tsc && npm run copy:files",
"build": "npm run compile",
"release": "np",
"version": "npm run build",
"prepublishOnly": "npm run build",
"lint": "eslint . --ext=.ts",
"format": "prettier --write .",
"commit": "git-cz",
"release": "np --message=\"chore(release): %s\"",
"version": "npm run build",
"sync-labels": "github-label-sync --labels ./node_modules/@adonisjs/mrm-preset/gh-labels.json poppinss/file-generator"
"sync-labels": "github-label-sync --labels .github/labels.json poppinss/file-generator"
},

@@ -42,4 +38,4 @@ "keywords": [

"devDependencies": {
"@adonisjs/mrm-preset": "^5.0.3",
"@adonisjs/require-ts": "^2.0.11",
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@japa/assert": "^1.3.4",

@@ -49,10 +45,11 @@ "@japa/run-failed-tests": "^1.0.7",

"@japa/spec-reporter": "^1.1.12",
"@swc/core": "^1.3.3",
"@types/bytes": "^3.1.1",
"@types/node": "^17.0.23",
"commitizen": "^4.2.4",
"copyfiles": "^2.4.1",
"cz-conventional-changelog": "^3.3.0",
"del-cli": "^4.0.1",
"eslint": "^8.13.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-adonis": "^2.1.0",
"eslint-plugin-adonis": "^3.0.2",
"eslint-plugin-prettier": "^4.0.0",

@@ -62,20 +59,18 @@ "file-type": "^17.1.1",

"husky": "^7.0.4",
"mrm": "^4.0.0",
"np": "^7.6.1",
"prettier": "^2.6.2",
"ts-node": "^10.9.1",
"typescript": "^4.6.3"
},
"mrmConfig": {
"core": false,
"license": "MIT",
"services": [
"github-actions"
],
"minNodeVersion": "16.13.1",
"probotApps": [
"stale",
"lock"
],
"runGhActionsOnWindows": true
"dependencies": {
"bytes": "^3.1.2"
},
"repository": {
"type": "git",
"url": "git+https://github.com/poppinss/file-generator.git"
},
"bugs": {
"url": "https://github.com/poppinss/file-generator/issues"
},
"homepage": "https://github.com/poppinss/file-generator#readme",
"eslintConfig": {

@@ -111,30 +106,12 @@ "extends": [

},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"publishConfig": {
"access": "public",
"tag": "latest"
"tag": "next"
},
"np": {
"contents": ".",
"message": "chore(release): %s",
"tag": "next",
"branch": "main",
"anyBranch": false
},
"dependencies": {
"bytes": "^3.1.2"
},
"main": "index.js",
"directories": {
"test": "tests"
},
"repository": {
"type": "git",
"url": "git+https://github.com/poppinss/file-generator.git"
},
"bugs": {
"url": "https://github.com/poppinss/file-generator/issues"
},
"homepage": "https://github.com/poppinss/file-generator#readme"
}
}

@@ -6,7 +6,9 @@ # File generator

This package allows you generate fake in-memory files for varying sizes. The generated file can be used during testing to test the file uploads functionality of your Node server.
> **Note**: This package is ESM only
- Support for `docx`, `xlsx`, `pdf`, `png`, `jpg`, and `gif` files.
This package allows you generate fake in-memory files of varying sizes. The generated file can be used during testing to test the file uploads functionality of your Node server.
- Support for `docx`, `csv`, `xlsx`, `pdf`, `png`, `jpg`, and `gif` files.
- Passes the [magic number file](https://gist.github.com/leommoore/f9e57ba2aa4bf197ebc5) validation.
- The file contents is kept in-memory Buffer. No files are written to the disk.
- The file contents are kept inside memory as a buffer. No files are written to the disk.

@@ -69,2 +71,13 @@ ## Installation

## Available methods
Following are the available methods to generate different files.
- `generateDocx` - Generate a Microsoft word doc file (passes [file-type][1] validation).
- `generateGif` - Generate a gif file (passes [file-type][1] validation).
- `generateJpg` - Generate a jpeg file (passes [file-type][1] validation).
- `generatePdf` - Generate a pdf file (passes [file-type][1] validation).
- `generatePng` - Generate a png file (passes [file-type][1] validation).
- `generateXlsx` - Generate a Microsoft excel spreadsheet (passes [file-type][1] validation).
- `generateCsv` - Generate a CSV file.
[github-actions-image]: https://img.shields.io/github/workflow/status/poppinss/file-generator/test?style=for-the-badge

@@ -81,1 +94,3 @@ [github-actions-url]: https://github.com/poppinss/file-generator/actions/workflows/test.yml "github-actions"

[typescript-url]: "typescript"
[1]: https://github.com/sindresorhus/file-type
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