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

@axiomhq/pino

Package Overview
Dependencies
Maintainers
7
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@axiomhq/pino - npm Package Compare versions

Comparing version 0.1.3 to 1.0.0-rc.1

.rollup.cache/home/runner/work/axiom-js/axiom-js/packages/pino/dist/cjs/index.js

10

CHANGELOG.md

@@ -10,2 +10,12 @@ # Changelog

## [1.0.0-rc.1] - 2023-09-27
### Breaking Change
- Axiom token is now required as a parameter of the constructor, automatic detection of environment variables is now removed.
## Fixed
- switched the build process to use rollup in order to solves the module resolution issue.
## [0.1.2] - 2023-06-26

@@ -12,0 +22,0 @@

15

dist/esm/index.js
import build from 'pino-abstract-transport';
import { Axiom } from '@axiomhq/js';
// The browsers don't have process.env, fake it
const process = typeof window === 'undefined' ? global.process : { env: {} };
export var AxiomEventLevel;
var AxiomEventLevel;
(function (AxiomEventLevel) {

@@ -15,5 +14,5 @@ AxiomEventLevel["Trace"] = "trace";

})(AxiomEventLevel || (AxiomEventLevel = {}));
export default async function axiomTransport(options) {
async function axiomTransport(options) {
const axiom = new Axiom(options);
const dataset = options?.dataset || process.env.AXIOM_DATASET;
const dataset = options.dataset;
return build(async function (source) {

@@ -32,3 +31,3 @@ for await (const obj of source) {

// See https://github.com/pinojs/pino/blob/master/docs/api.md#loggerlevel-string-gettersetter
export const mapLogLevel = (level) => {
const mapLogLevel = (level) => {
if (typeof level === 'string') {

@@ -57,2 +56,4 @@ return level;

};
//# sourceMappingURL=index.js.map
export { AxiomEventLevel, axiomTransport as default, mapLogLevel };
//# sourceMappingURL=index.js.map
{
"name": "@axiomhq/pino",
"version": "0.1.3",
"version": "1.0.0-rc.1",
"description": "The official Axiom transport for Pino",
"main": "dist/cjs/index.ts",
"types": "dist/types/index.d.ts",
"type": "module",
"types": "dist/esm/types/index.d.ts",
"module": "dist/esm/index.js",
"main": "dist/cjs/index.cjs",
"author": "Axiom, Inc.",

@@ -28,20 +29,19 @@ "license": "MIT",

"exports": {
"types": "./dist/esm/types/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"default": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts"
"require": "./dist/cjs/index.cjs",
"default": "./dist/esm/index.js"
},
"dependencies": {
"pino-abstract-transport": "^1.0.0",
"@axiomhq/js": "0.1.3"
"@axiomhq/js": "1.0.0-rc.1"
},
"scripts": {
"build": "tsc -b",
"build:esm": "tsc --project tsconfig.esm.json",
"build": "rollup -c rollup.config.js",
"build:cjs": "rollup -c rollup.config.cjs.js",
"format": "eslint 'src/**/*.{js,ts}' --quiet --fix",
"lint": "eslint 'src/**/*.{js,ts}'",
"test": "jest test/unit",
"prepublish": "npm run build && npm run build:esm",
"cover": "nyc -r text -e .ts -x 'tests/unit/**/*.spec.ts' npm run test"
"test": "vitest run test/unit/* --coverage",
"prepublish": "npm run build && npm run build:cjs"
}
}
import build from 'pino-abstract-transport';
import { Axiom, ClientOptions } from '@axiomhq/js';
// The browsers don't have process.env, fake it
const process: { env: Record<string, string | undefined> } =
typeof window === 'undefined' ? global.process : { env: {} };
export enum AxiomEventLevel {

@@ -19,9 +15,10 @@ Trace = 'trace',

export interface Options extends ClientOptions {
dataset?: string;
dataset: string;
}
export default async function axiomTransport(options?: Options) {
export default async function axiomTransport(options: Options) {
const axiom = new Axiom(options);
const dataset = options?.dataset || process.env.AXIOM_DATASET;
const dataset = options.dataset;
return build(

@@ -38,3 +35,3 @@ async function (source: any) {

axiom.ingest(dataset!, event);
axiom.ingest(dataset, event);
}

@@ -41,0 +38,0 @@ },

@@ -1,2 +0,2 @@

import { describe, it, expect } from '@jest/globals';
import { describe, it, expect } from 'vitest';
import axiomTransport from '../../src';

@@ -6,3 +6,3 @@

it('creates a truthy instance', () => {
const t = axiomTransport();
const t = axiomTransport({ token: process.env.AXIOM_TOKEN || '', dataset: process.env.AXIOM_DATASET || ''});
expect(t).toBeTruthy();

@@ -9,0 +9,0 @@ expect(t).toBeDefined();

{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"target": "ES5",
"module": "Commonjs",
"baseUrl": ".",
"target": "ESNext",
"module": "ES6",
"moduleResolution": "node",
"rootDir": "./src",
"outDir": "dist/cjs",
"outDir": "dist",
"declarationDir": "dist/types"

@@ -9,0 +11,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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