{"id":42644,"library":"dot-component","title":"dot","description":"MongoDB-style dot notation querying for JavaScript objects. It provides get, set, and parent traversal functions for nested object paths. This package is stable but very old (v0.1.1, last updated ~2013). It was designed for the now-defunct component(1) package manager and has no recent updates. Minimal and dependency-free, but lacks modern features like array index handling with brackets. Not actively maintained and best replaced by libraries like lodash._get or object-path.","status":"maintenance","version":"0.1.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","dot"],"install":[{"cmd":"npm install dot-component","lang":"bash","label":"npm"},{"cmd":"yarn add dot-component","lang":"bash","label":"yarn"},{"cmd":"pnpm add dot-component","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package uses CommonJS and does not support ESM imports. The module exports a single object with get, set, parent methods.","wrong":"import dot from 'dot'","symbol":"dot","correct":"const dot = require('dot')"},{"note":"get is not exported as a standalone function; it's a method on the default export.","wrong":"get(obj, path)","symbol":"get","correct":"dot.get(obj, path)"},{"note":"The fourth parameter init is optional; omitting it defaults to initializing missing paths.","wrong":"dot.set(obj, path, value, [init])","symbol":"set","correct":"dot.set(obj, path, value)"}],"quickstart":{"code":"const dot = require('dot')\nconst obj = {\n  name: {\n    first: 'tobi'\n  },\n  pets: [\n    { id: 1, name: 'loki' },\n    { id: 2, name: 'jane' }\n  ]\n}\nconsole.log(dot.get(obj, 'name.first'))\nconsole.log(dot.get(obj, 'pets.0.name'))\nconsole.log(dot.parent(obj, 'name.first'))\nconsole.log(dot.set(obj, 'pets.1.name', 'Jane'))\nconsole.log(obj.pets[1].name)","lang":"javascript","description":"Demonstrates basic usage of dot.get, dot.set, and dot.parent with nested objects and arrays."},"warnings":[{"fix":"Migrate to maintained alternatives like lodash.get or object-path.","message":"Package is no longer actively maintained and uses the deprecated component(1) package manager.","severity":"deprecated","affected_versions":"<=0.1.1"},{"fix":"Use dot-only paths with numeric indices separated by dots.","message":"Does not support bracket notation for array indices (e.g., 'pets[0].name') — only dot notation (e.g., 'pets.0.name').","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Pass false as the fourth argument to disable path initialization.","message":"The set function will create intermediate objects/arrays by default unless you pass false for the init parameter.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'1':43 '2013':33 'activ':67 'array':61 'best':70 'bracket':65 'compon':42 'defunct':41 'depend':54 'dependency-fre':53 'design':36 'dot':1,5,81 'featur':59 'free':55 'function':18 'get':13 'handl':63 'index':62 'javascript':9,80 'lack':57 'last':31 'librari':73 'like':60,74 'lodash._get':75 'maintain':68 'manag':45 'minim':51 'modern':58 'mongodb':3 'mongodb-styl':2 'nest':20 'notat':6 'now-defunct':39 'object':10,21,78 'object-path':77 'old':29 'packag':24,44 'parent':16 'path':22,79 'provid':12 'queri':7 'recent':49 'replac':71 'set':14 'stabl':26 'style':4 'travers':17 'updat':32,50 'v0.1.1':30","created_at":"2026-06-05T16:55:58.238344+00:00","updated_at":"2026-06-05T16:55:58.238344+00:00","problems":[{"fix":"Install via npm: npm install dot-component (the npm package name, not 'dot'). Or install the original from GitHub: npm install component/dot.","cause":"Not installed via npm; the package is not published on npm (only via component).","error":"Error: Cannot find module 'dot'"},{"fix":"Use require('dot') instead of import.","cause":"Incorrect import on ESM or bundlers expecting a default export.","error":"TypeError: dot.get is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"dot-component","openapi_spec":null,"status_page":null,"smithery":null,"categories":["developer-tools"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}