Catalog npm
Back to packageRELEASE DETAILS

0.2.1

npm

2famsg

Retrieves 2FA codes from Apple Messages

Published6 May 2020
Direct dependencies18
Transitive dependenciesNot calculated

README

Current package documentation

2famsg

npm npm License: MIT Twitter: @selfagency_llc

Retrieve 2FA codes from Apple Messages on MacOS as JSON output with CLI or API

Installation

npm install -g 2famsg || yarn global add 2famsg

CLI Usage

2famsg [-a | --alfred] [-d | --database DATABASE_PATH] [-q | --query QUERY_TERM]

Also available via npx but loads much more slowly.

CLI Options

  • -a or --alfred [Boolean]: Format output for Alfred
  • -d or --database [String]: Specify database path (Default: ~/Library/Messages/chat.db)
  • -q or --query [String]: Term by which to filter results (eg., facebook or amazon)

Node Module Usage

const twoFactorMsg = require('2famsg')
const codes = async () =>
  await twoFactorMsg({
    query: 'facebook'
  })

Module Options

  • alfred [Boolean]: Format output for Alfred
  • database [String]: Specify database path (Default: ~/Library/Messages/chat.db)
  • query [String]: Term by which to filter results (eg., facebook or amazon)

Build Binaries

npm run build:sqlite
npm run build:bin

Author

👤 Daniel Sieradski hello@self.agency

Acknowledgements

The SQLite query was lifted from Scott Carpenter's alfred-imessage-2fa Alfred workflow, which I modified somewhat. Scott's project was a great start but I was looking for a more robust solution and decided to build one in a language in which I felt more comfortable jamming on the code.

Contributing

Contributions, issues and feature requests are welcome! Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 18

Native requirements
18 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
dayjs
Environment
{
  "local_name": "dayjs",
  "alias": false,
  "peer_metadata": null
}
^1.8.26runtime
error
Environment
{
  "local_name": "error",
  "alias": false,
  "peer_metadata": null
}
^10.2.0runtime
sqlite-async
Environment
{
  "local_name": "sqlite-async",
  "alias": false,
  "peer_metadata": null
}
file:lib/asyncruntime
nexe
Environment
{
  "local_name": "nexe",
  "alias": false,
  "peer_metadata": null
}
^3.3.2development
eslint
Environment
{
  "local_name": "eslint",
  "alias": false,
  "peer_metadata": null
}
^6.6.0development
scripty
Environment
{
  "local_name": "scripty",
  "alias": false,
  "peer_metadata": null
}
^2.0.0development
prettier
Environment
{
  "local_name": "prettier",
  "alias": false,
  "peer_metadata": null
}
^2.0.5development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^3.8.3development
@babel/core
Environment
{
  "local_name": "@babel/core",
  "alias": false,
  "peer_metadata": null
}
^7.9.6development
babel-eslint
Environment
{
  "local_name": "babel-eslint",
  "alias": false,
  "peer_metadata": null
}
^10.1.0development
@babel/preset-env
Environment
{
  "local_name": "@babel/preset-env",
  "alias": false,
  "peer_metadata": null
}
^7.9.6development
eslint-plugin-node
Environment
{
  "local_name": "eslint-plugin-node",
  "alias": false,
  "peer_metadata": null
}
^11.1.0development
eslint-plugin-import
Environment
{
  "local_name": "eslint-plugin-import",
  "alias": false,
  "peer_metadata": null
}
^2.20.2development
eslint-plugin-promise
Environment
{
  "local_name": "eslint-plugin-promise",
  "alias": false,
  "peer_metadata": null
}
^4.2.1development
eslint-config-prettier
Environment
{
  "local_name": "eslint-config-prettier",
  "alias": false,
  "peer_metadata": null
}
^6.11.0development
eslint-plugin-prettier
Environment
{
  "local_name": "eslint-plugin-prettier",
  "alias": false,
  "peer_metadata": null
}
^3.1.3development
eslint-plugin-security
Environment
{
  "local_name": "eslint-plugin-security",
  "alias": false,
  "peer_metadata": null
}
^1.4.0development
eslint-plugin-standard
Environment
{
  "local_name": "eslint-plugin-standard",
  "alias": false,
  "peer_metadata": null
}
^4.0.1development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "8782d0d39cc6953d7dc6ee2203b078b15f70bdc1",
  "tarball": "https://registry.npmjs.org/2famsg/-/2famsg-0.2.1.tgz",
  "fileCount": 124,
  "integrity": "sha512-vrovQk9J+v3usfQsROn2t6LrokjbaKa6sJ0iGYt0K9tNPgURH4Dj6UHS5N570yAcRM+rltwkVUOpYps128CeiQ==",
  "signatures": [
    {
      "sig": "MEUCIQCoqKiZ3zDou70HMQW4EY4JysetjAK3qSIDk/GHPL1WNgIgIQHU2a6Kko0u/lo1iYNblrmVDbcV14qJa0KdIlFR0ag=",
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
    }
  ],
  "unpackedSize": 33180185,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesk9nCRA9TVsSAnZWagAAuJMP+QEYfI4fA+61Y17Oiu3a\nLBfUu7UPA7ulaxp5sbB9LI9RBJWRmmEAN+st5AYwbFdxMcGk0+EPIXdaUsc+\nkAcQkhpwMGyxv1TMWnGhqeWpqZUg37j69vcazGeuR+u4CJGvPivE9ZUDDjNC\nHP86XKBfmS/ApXFuyIVR02w7YpO9D/0XmMAt+a41bQ1+eOfPJGD6GFeEM6ft\nsOgw6ymSHbynjHuw1/wlZAVTXeWT+r3o9Tsy/lazaXOeuLGVsV8EEdCyRPoK\nzb6Ybbntqp5nFQIJ/bJNTzc9Ugpfpew94wfUTVhiyOioiMqyBHmRh/AKUZcB\nwFHbl9aANT80d6BVh9akawcQXpVL4r87JpwoyKqlbu9VwCTFo4IMBkuLnkm6\navymvGTmjb3dh2nonGZjNssGz+t8WR8AVh6tfWV/DNiBIm1zcMuBTT7/0r3c\nQXSbx25H3bPOZG7xxEWyOmfXR7FYAtB0kjFq57VOs7VJNm/SdHPCHQHVKC/x\ndQGwcqqpTTdhAtr7/IuHub9N93vLPkB5Df/kaGTakZYiT4KWfHDyfm43DoPW\npUS1TD1guPe52VGOqKfrL2ppCsg0FkfEVUqxb4/v63WDVkvsBsjl5gL4HInV\nwhyHP/wAchP1NT1i2tH9wH8dW+LCF/WAvdlt9TlDU3D79gJwI3qpfUSR33l1\nHL/h\r\n=lC5/\r\n-----END PGP SIGNATURE-----\r\n"
}

Repository

ACCESSIBLE
selfagency/2famsg

Shared repository data · GitLab

License detected in repository
Not collected
Contributor identities
1 · complete API traversal
Contributors · showing 1 of 1 collected
ContributorContributions
Daniel Sieradski21

Default-branch author identities; GitLab commit counts exclude merge commits.

Public sponsor counts have not been collected. These signals belong to the repository owner.

Downloads & popularity

1identities
Gauge · observed snapshots24 Oct 2026
10.50
2026-10-20: 1 · observed 2026-10-20T19:27:02.0182837Z2026-10-21: 1 · observed 2026-10-21T19:27:40.2277210Z2026-10-22: 1 · observed 2026-10-22T19:28:38.4246554Z2026-10-23: 1 · observed 2026-10-23T19:30:11.2813821Z2026-10-24: 1 · observed 2026-10-24T19:31:14.9846970Z
20 Oct24 Oct

gitlab · 5 observations shown. Missing days are unknown.

View observed values
Date / source periodValueObserved at
2026-10-2412026-10-24T19:31:14.9846970Z
2026-10-2312026-10-23T19:30:11.2813821Z
2026-10-2212026-10-22T19:28:38.4246554Z
2026-10-2112026-10-21T19:27:40.2277210Z
2026-10-2012026-10-20T19:27:02.0182837Z

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:13 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:8eee3b4c1e6d19557ab52707a53a740b6f6b5da19db66752dae2c1ba2425ee86

Other collected versions

0.2.527 May0.2.427 May0.2.326 May0.2.26 May0.2.06 May0.1.15 MayView all collected versions →