Skip to content

Commit

Permalink
Replace unmaintained uid-number package with passwd-user.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlongley committed Oct 14, 2024
1 parent 099a22a commit 8c269d2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# `@bedrock/core` ChangeLog

## 6.1.4 - 2024-10-dd

### Fixed
- Replace unmaintained `uid-number` package with `passwd-user`.

## 6.1.3 - 2024-03-06

### Fixed
Expand Down
6 changes: 2 additions & 4 deletions lib/loggers/fileLogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ import * as brUtil from '../util.js';
import * as formatters from './formatters.js';
import {config} from '../config.js';
import {promises as fs} from 'node:fs';
import {passwdUser} from 'passwd-user';
import path from 'node:path';
import {promisify} from 'node:util';
import uidNumber from 'uid-number';
import winston from 'winston';

const cc = brUtil.config.main.computer();
const getUserId = promisify(uidNumber);

// config filenames
// configured here instead of config.js due to util dependency issues
Expand Down Expand Up @@ -89,7 +87,7 @@ async function _chown(filename) {
uid = process.getuid();
} else {
try {
uid = await getUserId(uid);
({userIdentifier: uid} = await passwdUser(uid));
} catch(e) {
throw new brUtil.BedrockError(
`Unable to convert user "${uid}" to a numeric user id. ` +
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@
"commander": "^9.2.0",
"cycle": "^1.0.3",
"fast-safe-stringify": "^2.1.1",
"passwd-user": "^4.0.0",
"serialize-error": "^10.0.0",
"triple-beam": "^1.3.0",
"uid-number": "^0.0.6",
"winston": "^3.7.2",
"winston-transport": "^4.5.0"
},
"devDependencies": {
"eslint": "^8.57.0",
"eslint-config-digitalbazaar": "^5.0.1",
"eslint-plugin-jsdoc": "^48.2.0",
"eslint-plugin-unicorn": "^51.0.1",
"eslint-plugin-jsdoc": "^50.4.1",
"eslint-plugin-unicorn": "^56.0.0",
"jsdoc": "^4.0.2",
"jsdoc-to-markdown": "^8.0.1"
"jsdoc-to-markdown": "^9.0.2"
},
"engines": {
"node": ">=18"
Expand Down

0 comments on commit 8c269d2

Please sign in to comment.